Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent redundant patching of History API methods #18

Merged
merged 2 commits into from
Feb 26, 2024

Commits on Feb 26, 2024

  1. fix: prevent redundant patching of History API methods

    The previous implementation of patching the History API methods (pushState and replaceState) was causing them to increasingly nest within patched versions of themselves.
    
    To fix this, a new flag `isHistoryPatched` was introduced to prevent redundant patching. The `stopProgressOnHistoryUpdate` function now checks if the flag is already set before applying the patch. Additionally, the flag is set to `true` after the patching is done to ensure it is only applied once.
    
    Reference: TheSGJ/nextjs-toploader#68
    tomcru committed Feb 26, 2024
    Configuration menu
    Copy the full SHA
    820bd33 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3b53593 View commit details
    Browse the repository at this point in the history