From 2b4e5a1f013a7768475fa1fdd63b93d820f0e768 Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <0xsysr3ll@pm.me> Date: Sun, 7 Dec 2025 20:28:12 +0100 Subject: [PATCH] fix(webpush): delete push subscriptions for multiple devices Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me> --- .../UserNotificationsWebPush/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx b/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx index 56fe7afd7..51d7d3ec4 100644 --- a/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx +++ b/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx @@ -119,6 +119,14 @@ const UserWebPushSettings = () => { if (endpointToDelete) { await deletePushSubscriptionFromBackend(endpointToDelete); + } else if (dataDevices && dataDevices.length > 0) { + for (const device of dataDevices) { + try { + await deletePushSubscriptionFromBackend(device.endpoint); + } catch (error) { + // Continue deleting other subscriptions even if one fails + } + } } localStorage.setItem('pushNotificationsEnabled', 'false');