mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-28 16:38:23 +01:00
fix logout behavior when there is no push subscription 2
This commit is contained in:
parent
f6d8867df2
commit
b2e21db0b3
1 changed files with 12 additions and 10 deletions
|
@ -33,6 +33,7 @@ export async function signout() {
|
||||||
|
|
||||||
//#region Remove push notification registration
|
//#region Remove push notification registration
|
||||||
try {
|
try {
|
||||||
|
if (navigator.serviceWorker.controller) {
|
||||||
const registration = await navigator.serviceWorker.ready;
|
const registration = await navigator.serviceWorker.ready;
|
||||||
const push = await registration.pushManager.getSubscription();
|
const push = await registration.pushManager.getSubscription();
|
||||||
if (push) {
|
if (push) {
|
||||||
|
@ -44,6 +45,7 @@ export async function signout() {
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue