2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00

fix: Reset route on database change

This commit is contained in:
Faris Ansari 2020-02-03 23:12:34 +05:30
parent d181545c70
commit 5316756843

View File

@ -10,11 +10,11 @@
<Desk class="flex-1" v-if="activeScreen === 'Desk'" />
<DatabaseSelector
v-if="activeScreen === 'DatabaseSelector'"
@database-connect="showSetupWizardOrDesk"
@database-connect="showSetupWizardOrDesk(true)"
/>
<SetupWizard
v-if="activeScreen === 'SetupWizard'"
@setup-complete="showSetupWizardOrDesk"
@setup-complete="showSetupWizardOrDesk(true)"
/>
<Settings v-if="activeScreen === 'Settings'" />
<portal-target name="popovers" multiple></portal-target>
@ -78,7 +78,7 @@ export default {
}
},
methods: {
showSetupWizardOrDesk() {
showSetupWizardOrDesk(resetRoute = false) {
const { setupComplete } = frappe.AccountingSettings;
if (!setupComplete) {
this.activeScreen = 'SetupWizard';
@ -88,6 +88,9 @@ export default {
this.activeScreen = 'Desk';
this.checkForUpdates();
}
if (resetRoute) {
this.$router.replace('/');
}
},
reloadMainWindowOnSettingsClose() {
if (this.activeScreen === 'Settings') {