From 2f3a942583f1cc1f469f3fe9266ae781308003f6 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 31 Aug 2021 20:47:39 +0900 Subject: [PATCH] fix --- src/client/account.ts | 6 ++++-- src/client/components/signup.vue | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/account.ts b/src/client/account.ts index ee1d845493..69755819fe 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -1,4 +1,4 @@ -import { get, set } from '@client/scripts/idb-proxy'; +import { del, get, set } from '@client/scripts/idb-proxy'; import { reactive } from 'vue'; import { apiUrl } from '@client/config'; import { waiting } from '@client/os'; @@ -26,7 +26,9 @@ export async function signout() { //#region Remove account const accounts = await getAccounts(); accounts.splice(accounts.findIndex(x => x.id === $i.id), 1); - set('accounts', accounts); + + if (accounts.length > 0) await set('accounts', accounts); + else await del('accounts'); //#endregion //#region Remove push notification registration diff --git a/src/client/components/signup.vue b/src/client/components/signup.vue index b53eb6f64a..d332274111 100644 --- a/src/client/components/signup.vue +++ b/src/client/components/signup.vue @@ -185,7 +185,7 @@ export default defineComponent({ this.$emit('signup', res); if (this.autoSet) { - return login(res.token); + return login(res.i); } }); }).catch(() => {