Use Groups store in Options view to remove a request

This commit is contained in:
Bubka
2023-11-02 08:13:31 +01:00
parent 8845027800
commit d8861ba475
3 changed files with 18 additions and 18 deletions

View File

@ -29,22 +29,22 @@ export const useUserStore = defineStore({
*
* @param {object} user
*/
loginAs(user) {
async loginAs(user) {
this.$patch(user)
this.initDataStores()
await this.initDataStores()
this.applyUserPrefs()
},
/**
* Initializes the user's data stores
*/
initDataStores() {
async initDataStores() {
const accounts = useTwofaccounts()
const groups = useGroups()
if (this.isAuthenticated) {
accounts.fetch()
groups.fetch()
await accounts.fetch()
await groups.fetch()
}
else {
accounts.$reset()