Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: replace series function used to queue async callbacks (#11485)
**Motivation** This function is used to ensure that all state change callbacks to sync the local browser history state run in series. The functions are async because `history.go` is not a synchronous function. I noticed that in chrome, the URL was updating to the previous url instead of the new one in some navigations and tracked it down to the fact that the `history.go` navigation takes longer than in other browsers. This function is supposed to mitigate that, but I believe it has a bug. The function will not properly return early, because the finally clause will still always run and immediately reset the `isRunning` state. Even after fixing this, the function didn't quite work right for queuing more than two callbacks. I have replaced the function with a simpler implementation that does the same task. **Test plan** Describe the **steps to test this change** so that a reviewer can verify it. Provide screenshots or videos if the change affects UI. The change must pass lint, typescript and tests. --------- Co-authored-by: Michał Osadnik <micosa97@gmail.com>
- Loading branch information
1 parent
fab2cc6
commit d8dc693
Showing
2 changed files
with
15 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters