feat: defer everything until the api config is loaded #926
|
@ -89,6 +89,7 @@ export default {
|
|||
async setApiUrl() {
|
||||
if (this.apiUrl === '') {
|
||||
// Don't try to check and set an empty url
|
||||
konrad marked this conversation as resolved
Outdated
|
||||
this.errorMsg = this.$t('apiConfig.urlRequired')
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
That seems like it should throw an error? That seems like it should throw an error?
konrad
commented
It does yeah. I've modified it so it shows an error with a "good" error message to the user instead of throwing one. It does yeah. I've modified it so it shows an error with a "good" error message to the user instead of throwing one.
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -97,7 +98,7 @@ export default {
|
|||
|
||||
konrad marked this conversation as resolved
dpschen
commented
Explain why we return here Explain why we return here
|
||||
if (url === '') {
|
||||
// If the config setter function could not figure out a url
|
||||
konrad marked this conversation as resolved
Outdated
dpschen
commented
That seems like it should throw an error? (2) That seems like it should throw an error? (2)
|
||||
return
|
||||
throw new Error('URL cannot be empty.')
|
||||
}
|
||||
|
||||
// Set it + save it to local storage to save us the hoops
|
||||
|
|
|
@ -787,7 +787,8 @@
|
|||
"change": "change",
|
||||
"signInOn": "Sign in to your Vikunja account on {0}",
|
||||
"error": "Could not find or use Vikunja installation at \"{domain}\". Please try a different url.",
|
||||
"success": "Using Vikunja installation at \"{domain}\"."
|
||||
"success": "Using Vikunja installation at \"{domain}\".",
|
||||
"urlRequired": "A url is required."
|
||||
},
|
||||
"loadingError": {
|
||||
"failed": "Loading failed, please {0}. If the error persists, please {1}.",
|
||||
|
|
Reference in New Issue
Explain why we return here
Done.