Skip to content

Commit

Permalink
Reset minijs when user navigate back
Browse files Browse the repository at this point in the history
  • Loading branch information
notthatjen committed Jun 9, 2024
1 parent faaaa70 commit b264c14
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ const MiniJS = (() => {
console.error('Error initializing MiniJS:', error)
})

// Reset MiniJS when the user navigates back
window.addEventListener('popstate', () => {
mini.reset().catch((error) => {
console.error('Error resetting MiniJS after navigation:', error);
});
});

return {
get debug() {
return Mini.debug
Expand Down

0 comments on commit b264c14

Please sign in to comment.