mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-23 18:29:19 -05:00
fix(webpush): notification must reflect the actual outcome
Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me>
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user