Skip to content

Commit

Permalink
[FIX] notification preference status was not updated in the database (E…
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk authored and vsabatie committed Nov 22, 2023
1 parent 4aedef4 commit 212b1c0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pod/progressive_web_app/static/js/notification-toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ async function setPushPreference(notificationSettingUrl) {
notificationButton.disabled = true;

let afterBrowserNotificationPermissionChanged = async function (
subscription,
subscription, acceptsNotifications=true,
) {
acceptsNotifications = subscription != null;
let response = await postNotificationPreference(
acceptsNotifications,
notificationSettingUrl,
Expand Down Expand Up @@ -74,7 +73,7 @@ async function setPushPreference(notificationSettingUrl) {
subscribe(registration, afterBrowserNotificationPermissionChanged);
} else if (permissionState == "granted" && subscription) {
subscription.unsubscribe().then(() => {
afterBrowserNotificationPermissionChanged(subscription);
afterBrowserNotificationPermissionChanged(subscription, false);
});
}
}
Expand Down

0 comments on commit 212b1c0

Please sign in to comment.