From 7fabd0b1c0ba86a5b58669d3c5d8ddd76b172c2c 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 7e8ebc1f1..9338ddb2e 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 () => {