fix(webpush): store push notification status in localStorage

Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me>
This commit is contained in:
0xsysr3ll
2025-12-07 15:09:30 +01:00
parent 37cc665706
commit 7fabd0b1c0

View File

@@ -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 () => {