From 4dbb7cdf2da6d2a4852ae49b21fb2434f9b56d00 Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <0xsysr3ll@pm.me> Date: Sun, 7 Dec 2025 15:09:30 +0100 Subject: [PATCH] fix(webpush): store push notification status in localStorage Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me> --- .../UserNotificationsWebPush/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx b/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx index 7e8ebc1f..9338ddb2 100644 --- a/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx +++ b/src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx @@ -163,12 +163,15 @@ const UserWebPushSettings = () => { const verifyWebPush = async () => { const enabled = await verifyPushSubscription(user?.id, currentSettings); setWebPushEnabled(enabled); + if (enabled) { + localStorage.setItem('pushNotificationsEnabled', 'true'); + } }; if (user?.id) { verifyWebPush(); } - }, [user?.id, currentSettings]); + }, [user?.id, currentSettings, dataDevices]); useEffect(() => { const getSubscriptionEndpoint = async () => {