diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-08-21 11:51:46 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-08-21 11:51:46 +0900 |
| commit | 8ab9068d8e1a8362cbbb413d7abdc72233e9fa6e (patch) | |
| tree | df0fb673ac991890ed54c67b00189c1d716d1427 /src | |
| parent | fix(client): ノートの「削除して編集」をするとアンケート... (diff) | |
| download | sharkey-8ab9068d8e1a8362cbbb413d7abdc72233e9fa6e.tar.gz sharkey-8ab9068d8e1a8362cbbb413d7abdc72233e9fa6e.tar.bz2 sharkey-8ab9068d8e1a8362cbbb413d7abdc72233e9fa6e.zip | |
fix bug
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/account.ts | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/client/account.ts b/src/client/account.ts index cf52c4d828..7cd3d8cb88 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -29,16 +29,18 @@ export async function signout() { //#endregion //#region Remove push notification registration - const registration = await navigator.serviceWorker.ready; - const push = await registration.pushManager.getSubscription(); - if (!push) return; - await fetch(`${apiUrl}/sw/unregister`, { - method: 'POST', - body: JSON.stringify({ - i: $i.token, - endpoint: push.endpoint, - }), - }); + try { + const registration = await navigator.serviceWorker.ready; + const push = await registration.pushManager.getSubscription(); + if (!push) return; + await fetch(`${apiUrl}/sw/unregister`, { + method: 'POST', + body: JSON.stringify({ + i: $i.token, + endpoint: push.endpoint, + }), + }); + } catch (e) {} //#endregion document.cookie = `igi=; path=/`; |