refactor: localStorageのaccountsはindexedDBで保持するように (#7609)
* accountsストアはindexedDBで保持するように
* fix lint
* fix indexeddb available detection
* remove debugging code
* fix lint
* resolve ba756204b7 (diff-f565878e8202f0037b830c780b7c0932dc1bb5fd3d05ede14d72d10efbc3740c)
Firefoxでの動作を改善
* fix lint
* fix lint
* add changelog
This commit is contained in:
@@ -48,10 +48,10 @@ export default defineComponent({
|
||||
title: this.$ts.accounts,
|
||||
icon: 'fas fa-users',
|
||||
},
|
||||
storedAccounts: getAccounts().filter(x => x.id !== this.$i.id),
|
||||
storedAccounts: getAccounts().then(accounts => accounts.filter(x => x.id !== this.$i.id)),
|
||||
accounts: null,
|
||||
init: () => os.api('users/show', {
|
||||
userIds: this.storedAccounts.map(x => x.id)
|
||||
init: async () => os.api('users/show', {
|
||||
userIds: (await this.storedAccounts).map(x => x.id)
|
||||
}).then(accounts => {
|
||||
this.accounts = accounts;
|
||||
}),
|
||||
@@ -104,8 +104,8 @@ export default defineComponent({
|
||||
}, 'closed');
|
||||
},
|
||||
|
||||
switchAccount(account: any) {
|
||||
const storedAccounts = getAccounts();
|
||||
async switchAccount(account: any) {
|
||||
const storedAccounts = await getAccounts();
|
||||
const token = storedAccounts.find(x => x.id === account.id).token;
|
||||
this.switchAccountWithToken(token);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user