From 4b4272dc102ad695de95b1c490e4f004721afb90 Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <0xsysr3ll@pm.me> Date: Wed, 17 Dec 2025 18:07:00 +0100 Subject: [PATCH] fix(webpush): set push notification status only if not previously set Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me> --- .../UserNotificationsWebPush/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx b/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx index fde07b2c2..f86191e42 100644 --- a/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx +++ b/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx @@ -191,10 +191,12 @@ const UserWebPushSettings = () => { } setWebPushEnabled(isEnabled); - localStorage.setItem( - 'pushNotificationsEnabled', - isEnabled ? 'true' : 'false' - ); + if (localStorage.getItem('pushNotificationsEnabled') === null) { + localStorage.setItem( + 'pushNotificationsEnabled', + isEnabled ? 'true' : 'false' + ); + } }; if (user?.id) {