From 94219195e69fddf7661d1d5cb0d329023c738e94 Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <0xsysr3ll@pm.me> Date: Sun, 7 Dec 2025 20:38:43 +0100 Subject: [PATCH] fix(webpush): notification must reflect the actual outcome Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me> --- .../UserNotificationsWebPush/index.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx b/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx index 51d7d3ec..4e18c1f3 100644 --- a/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx +++ b/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx @@ -120,13 +120,23 @@ const UserWebPushSettings = () => { if (endpointToDelete) { await deletePushSubscriptionFromBackend(endpointToDelete); } else if (dataDevices && dataDevices.length > 0) { + let hasFailures = false; + for (const device of dataDevices) { try { await deletePushSubscriptionFromBackend(device.endpoint); } catch (error) { - // Continue deleting other subscriptions even if one fails + hasFailures = true; } } + + if (hasFailures) { + addToast(intl.formatMessage(messages.disablingwebpusherror), { + autoDismiss: true, + appearance: 'error', + }); + return; + } } localStorage.setItem('pushNotificationsEnabled', 'false');