Skip to content

Commit d0a6104

Browse files
committed
fix(webpush): store push notification status in localStorage
Signed-off-by: 0xsysr3ll <[email protected]>
1 parent 7758e0a commit d0a6104

File tree

1 file changed

+4
-1
lines changed
  • src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush

1 file changed

+4
-1
lines changed

src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,15 @@ const UserWebPushSettings = () => {
163163
const verifyWebPush = async () => {
164164
const enabled = await verifyPushSubscription(user?.id, currentSettings);
165165
setWebPushEnabled(enabled);
166+
if (enabled) {
167+
localStorage.setItem('pushNotificationsEnabled', 'true');
168+
}
166169
};
167170

168171
if (user?.id) {
169172
verifyWebPush();
170173
}
171-
}, [user?.id, currentSettings]);
174+
}, [user?.id, currentSettings, dataDevices]);
172175

173176
useEffect(() => {
174177
const getSubscriptionEndpoint = async () => {

0 commit comments

Comments
 (0)