From 31ae413da4e78ae0f93e13475e4d503a662fd606 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 7 Jan 2023 10:36:21 -0800 Subject: [PATCH] fix: allow logout without push notifications (#856) --- composables/users.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composables/users.ts b/composables/users.ts index e4dce99c..0cdf110a 100644 --- a/composables/users.ts +++ b/composables/users.ts @@ -183,6 +183,9 @@ export function getUsersIndexByUserId(userId: string) { } export async function removePushNotificationData(user: UserLogin, fromSWPushManager = true) { + if (!user.pushSubscription) + return + // clear push subscription user.pushSubscription = undefined const { acct } = user.account