From 68ed5a4b4fd62d74873738494b10ded579d9f2c2 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 8 Oct 2024 18:52:34 +0530 Subject: [PATCH] chore: source account id directly --- app/javascript/dashboard/App.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/javascript/dashboard/App.vue b/app/javascript/dashboard/App.vue index e9989d87b..4e1e53969 100644 --- a/app/javascript/dashboard/App.vue +++ b/app/javascript/dashboard/App.vue @@ -52,8 +52,11 @@ export default { currentUser: 'getCurrentUser', authUIFlags: 'getAuthUIFlags', accountUIFlags: 'accounts/getUIFlags', - currentAccountId: 'getCurrentAccountId', + // currentAccountId: 'getCurrentAccountId', }), + currentAccountId() { + return this.$route.params.accountId; + }, hasAccounts() { const { accounts = [] } = this.currentUser || {}; return accounts.length > 0; @@ -81,10 +84,11 @@ export default { created() { this.setLocale(window.chatwootConfig.selectedLocale); }, - mounted() { + async mounted() { + this.setLocale(window.chatwootConfig.selectedLocale); this.initializeColorTheme(); this.listenToThemeChanges(); - this.initializeAccount(); + await this.$store.dispatch('accounts/get'); }, unmounted() { if (this.reconnectService) { @@ -100,9 +104,7 @@ export default { mql.onchange = e => setColorTheme(e.matches); }, setLocale(locale) { - console.log('setting locale in dashboard', locale); - return; - // this.$i18n.locale = locale; + this.$i18n.locale = locale; }, async initializeAccount() { await this.$store.dispatch('accounts/get');