Skip to content

Commit

Permalink
Merge pull request #32 from zecka/patch-2
Browse files Browse the repository at this point in the history
fix: Disable loader on replace state to handle cached redirection (#17)
  • Loading branch information
ndungtse authored Oct 16, 2024
2 parents 1586350 + 52c86e2 commit bb3324a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/AppProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,16 @@ export const Next13ProgressBar = React.memo(
const mutationObserver = new MutationObserver(handleMutation);
mutationObserver.observe(document, { childList: true, subtree: true });

window.history.pushState = new Proxy(window.history.pushState, {
const proxyStateChange = new Proxy(window.history.pushState, {
apply: (target, thisArg, argArray: PushStateInput) => {
stopProgress();
return target.apply(thisArg, argArray);
},
});

window.history.pushState = proxyStateChange;
window.history.replaceState = proxyStateChange;

}, []);

return styles;
Expand Down

0 comments on commit bb3324a

Please sign in to comment.