Skip to content

Commit

Permalink
fix: should use event listener (#1701)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Jan 29, 2025
1 parent 1a2a763 commit 17ad70a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extensions/surveys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ export function usePopupVisibility(
}

// Listen for browser back/forward browser history changes
window.addEventListener('popstate', checkUrlMatch)
addEventListener(window, 'popstate', checkUrlMatch)
// Listen for hash changes, for SPA frameworks that use hash-based routing
// The hashchange event is fired when the fragment identifier of the URL has changed (the part of the URL beginning with and following the # symbol).
window.addEventListener('hashchange', checkUrlMatch)
addEventListener(window, 'hashchange', checkUrlMatch)

// Listen for SPA navigation
const originalPushState = window.history.pushState
Expand Down

0 comments on commit 17ad70a

Please sign in to comment.