summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-08-21 11:51:46 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-08-21 11:51:46 +0900
commit8ab9068d8e1a8362cbbb413d7abdc72233e9fa6e (patch)
treedf0fb673ac991890ed54c67b00189c1d716d1427 /src/client
parentfix(client): ノートの「削除して編集」をするとアンケート... (diff)
downloadsharkey-8ab9068d8e1a8362cbbb413d7abdc72233e9fa6e.tar.gz
sharkey-8ab9068d8e1a8362cbbb413d7abdc72233e9fa6e.tar.bz2
sharkey-8ab9068d8e1a8362cbbb413d7abdc72233e9fa6e.zip
fix bug
Diffstat (limited to 'src/client')
-rw-r--r--src/client/account.ts22
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=/`;