fix: skip removal of notifications if pwa not enabled

pull/455/head
Daniel Roe 2022-12-17 23:54:16 +00:00
rodzic f0c91a3974
commit 80ad2ab607
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 22D5008E4F5D9B55
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -96,6 +96,9 @@ export async function loginTo(user?: Omit<UserLogin, 'account'> & { account?: Ac
}
export async function removePushNotifications(user: UserLogin, fromSWPushManager = true) {
if (!useRuntimeConfig().public.pwaEnabled || !user.pushSubscription)
return
// unsubscribe push notifications
try {
await useMasto().pushSubscriptions.remove()