From 3a73d01d2a66069c80ea5b85263460f26c1666af Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Mon, 23 Oct 2023 13:57:37 +0200 Subject: [PATCH] fix: missing `setUser` refactor --- src/App.vue | 4 ++-- src/stores/base.js | 1 + src/views/Login.vue | 3 +-- src/views/Settings.vue | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3f155031f23..683bde6741b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -538,7 +538,7 @@ export default { 'init', 'initNodes', 'setAppInfo', - 'setUser', + 'onUserLogged', 'updateValue', 'setValue', 'removeValue', @@ -569,7 +569,7 @@ export default { ) if (response.success) { this.closePasswordDialog() - this.setUser(response.user) + this.onUserLogged(response.user) } } catch (error) { this.showSnackbar( diff --git a/src/stores/base.js b/src/stores/base.js index b6bf8707017..e09c4731e96 100644 --- a/src/stores/base.js +++ b/src/stores/base.js @@ -496,6 +496,7 @@ const useBaseStore = defineStore('base', { }, setDarkMode(value) { settings.store('dark', value) + // the `darkMode` watcher in App.vue will change vuetify theme this.ui.darkMode = value const metaThemeColor = document.querySelector( diff --git a/src/views/Login.vue b/src/views/Login.vue index 5540814617c..4f3bc72cedb 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -131,7 +131,6 @@ export default { }, set(value) { this.setDarkMode(value) - this.$vuetify.theme.dark = value }, }, }, @@ -204,7 +203,7 @@ export default { user.rememberMe = this.rememberMe localStorage.setItem('user', JSON.stringify(user)) localStorage.setItem('logged', 'true') - useBaseStore().setUser(user) + useBaseStore().onUserLogged(user) if (this.$route.params.nextUrl != null) { this.$router.push(this.$route.params.nextUrl) diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 6e483189782..7a15bc3d496 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -1425,7 +1425,6 @@ export default { }, set(value) { this.setDarkMode(value) - this.$vuetify.theme.dark = value }, }, internalNavTabs: {