feat: check for empty url
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
acc315b581
commit
a7a7c75dc5
|
@ -5,7 +5,10 @@
|
|||
<section v-else-if="error !== ''">
|
||||
<no-auth-wrapper>
|
||||
<card>
|
||||
<div class="notification is-danger">
|
||||
<p v-if="error === errorNoApiUrl">
|
||||
{{ $t('ready.noApiUrlConfigured') }}
|
||||
</p>
|
||||
<div class="notification is-danger" v-else>
|
||||
<p>
|
||||
{{ $t('ready.errorOccured') }}<br/>
|
||||
{{ error }}
|
||||
|
@ -34,6 +37,8 @@ import logoUrl from '@/assets/logo.svg'
|
|||
import ApiConfig from '@/components/misc/api-config'
|
||||
import NoAuthWrapper from '@/components/misc/no-auth-wrapper'
|
||||
|
||||
const ERROR_NO_API_URL = 'noApiUrlProvided'
|
||||
|
||||
export default {
|
||||
name: 'ready',
|
||||
components: {
|
||||
|
@ -44,6 +49,7 @@ export default {
|
|||
return {
|
||||
logoUrl,
|
||||
error: '',
|
||||
errorNoApiUrl: ERROR_NO_API_URL,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -54,11 +60,16 @@ export default {
|
|||
return this.$store.state.vikunjaReady
|
||||
},
|
||||
showLoading() {
|
||||
return !this.ready || this.error !== ''
|
||||
return !this.ready && this.error === ''
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
load() {
|
||||
if (window.API_URL === '') {
|
||||
this.error = ERROR_NO_API_URL
|
||||
return
|
||||
}
|
||||
|
||||
this.$store.dispatch('loadApp')
|
||||
.catch(e => {
|
||||
this.error = e
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
"ready": {
|
||||
"loading": "Vikunja is loading…",
|
||||
"errorOccured": "An error occured:",
|
||||
"checkApiUrl": "Please check if the api url is correct below."
|
||||
"checkApiUrl": "Please check if the api url is correct.",
|
||||
"noApiUrlConfigured": "No API url was configured. Please set one below:"
|
||||
},
|
||||
"user": {
|
||||
"auth": {
|
||||
|
|
Reference in New Issue