remove api call in postinstall

This commit is contained in:
Axolotle 2020-11-05 13:42:18 +01:00
parent 7f2144fee0
commit 445f4c44a7
2 changed files with 9 additions and 3 deletions

View file

@ -62,7 +62,9 @@ export default {
props: {
title: { type: String, required: true },
submitText: { type: String, default: null },
serverError: { type: String, default: '' }
serverError: { type: String, default: '' },
// Do not query the api (used by postinstall)
noStore: { type: Boolean, default: false }
},
data () {
@ -100,7 +102,7 @@ export default {
...mapGetters(['domains']),
dynDnsForbiden () {
if (!this.domains) return true
if (!this.domains) return false
const dynDomains = this.fields.dynDomain.props.choices
return this.domains.some(domain => {
return dynDomains.some(dynDomain => domain.includes(dynDomain))
@ -137,6 +139,7 @@ export default {
},
created () {
if (this.noStore) return
this.$store.dispatch('FETCH', { uri: 'domains' }).then(() => {
if (this.dynDnsForbiden) {
this.selected = 'domain'

View file

@ -17,7 +17,10 @@
<!-- DOMAIN SETUP STEP -->
<template v-else-if="step === 'domain'">
<domain-form :title="$t('postinstall_set_domain')" :submit-text="$t('next')" @submit="setDomain">
<domain-form
:title="$t('postinstall_set_domain')" :submit-text="$t('next')"
no-store @submit="setDomain"
>
<template #disclaimer>
<b-alert variant="warning" show v-t="'postinstall_domain'" />
</template>