Skip to content
Snippets Groups Projects
Commit 8ab9068d authored by syuilo's avatar syuilo
Browse files

fix bug

parent 47dd30d3
No related branches found
No related tags found
No related merge requests found
......@@ -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=/`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment