Skip to content

Commit

Permalink
Change beforeunload -> pagehide event where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
ahukkanen committed Aug 8, 2024
1 parent 75bb799 commit 2f6654f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion decidim-core/app/packs/src/decidim/impersonation.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $(() => {
}, 1000);

// Prevent reload when page is already unloading, otherwise it may cause infinite reloads.
window.addEventListener("beforeunload", () => {
window.addEventListener("pagehide", () => {
clearInterval(exitInterval);
return;
});
Expand Down
2 changes: 1 addition & 1 deletion decidim-core/app/packs/src/decidim/session_timeouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ $(() => {
setTimer(timeoutInSeconds);
});

window.addEventListener("beforeunload", () => {
window.addEventListener("pagehide", () => {
clearInterval(exitInterval);
return;
});
Expand Down

0 comments on commit 2f6654f

Please sign in to comment.