fix indexeddb available detection

This commit is contained in:
tamaina
2021-07-27 01:44:50 +09:00
parent 66b4eaf72e
commit 8e14463215
5 changed files with 27 additions and 15 deletions

View File

@@ -135,7 +135,7 @@ export default defineComponent({
},
async openAccountMenu(ev) {
const storedAccounts = getAccounts().filter(x => x.id !== this.$i.id);
const storedAccounts = await getAccounts().then(accounts => accounts.filter(x => x.id !== this.$i.id));
const accountsPromise = os.api('users/show', { userIds: storedAccounts.map(x => x.id) });
const accountItemPromises = storedAccounts.map(a => new Promise(res => {
@@ -195,8 +195,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);
},