From 80ad2ab60785e0e4c5dfa05e8945f2dfc48d713a Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 17 Dec 2022 23:54:16 +0000 Subject: [PATCH] fix: skip removal of notifications if pwa not enabled --- composables/users.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composables/users.ts b/composables/users.ts index b59a93be..d06647d9 100644 --- a/composables/users.ts +++ b/composables/users.ts @@ -96,6 +96,9 @@ export async function loginTo(user?: Omit & { 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()