Skip to content

Commit

Permalink
fix: missing setUser refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Oct 23, 2023
1 parent 82c4a07 commit 3a73d01
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ export default {
'init',
'initNodes',
'setAppInfo',
'setUser',
'onUserLogged',
'updateValue',
'setValue',
'removeValue',
Expand Down Expand Up @@ -569,7 +569,7 @@ export default {
)
if (response.success) {
this.closePasswordDialog()
this.setUser(response.user)
this.onUserLogged(response.user)
}
} catch (error) {
this.showSnackbar(
Expand Down
1 change: 1 addition & 0 deletions src/stores/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ export default {
},
set(value) {
this.setDarkMode(value)
this.$vuetify.theme.dark = value
},
},
},
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,6 @@ export default {
},
set(value) {
this.setDarkMode(value)
this.$vuetify.theme.dark = value
},
},
internalNavTabs: {
Expand Down

0 comments on commit 3a73d01

Please sign in to comment.