diff --git a/src/client/account.ts b/src/client/account.ts index 85fbca2bd7..323dd52afd 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -20,13 +20,13 @@ export async function signout() { //#region Remove account const accounts = await getAccounts(); - accounts.splice(accounts.findIndex(x => x.id === $i.id), 1) + accounts.splice(accounts.findIndex(x => x.id === $i.id), 1); set('accounts', JSON.stringify(accounts)); //#endregion //#region Remove push notification registration await navigator.serviceWorker.ready.then(async r => { - const push = await r.pushManager.getSubscription() + const push = await r.pushManager.getSubscription(); if (!push) return; return fetch(`${apiUrl}/sw/unregister`, { method: 'POST', @@ -39,7 +39,7 @@ export async function signout() { //#endregion document.cookie = `igi=; path=/`; - + if (accounts.length > 0) login(accounts[0].token); else location.href = '/'; } @@ -91,7 +91,7 @@ export function refreshAccount() { fetchAccount($i.token).then(updateAccount); } -export async function login(token: Account['token'], showTimeline?: boolean) { +export async function login(token: Account['token'], showTimeline: boolean = false) { waiting(); if (_DEV_) console.log('logging as token ', token); const me = await fetchAccount(token); diff --git a/src/client/sw/sw.ts b/src/client/sw/sw.ts index d69b7693d5..1fc5f1306f 100644 --- a/src/client/sw/sw.ts +++ b/src/client/sw/sw.ts @@ -116,7 +116,7 @@ self.addEventListener('notificationclick', ev => { self.addEventListener('notificationclose', async ev => { self.registration.showNotification('notificationclose'); const { notification } = ev; - const { data } = notification + const { data } = notification; if (data.isNotification) { const { origin } = location;