Only trigger one refresh going Back to list view. #3476
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If going back from a report page to a list page, a marker refresh would
be triggered twice, once by the popstate, once by display_around. As
only one of those had use_page set, it would at best make two identical
requests, at worst return to page 1 of results whatever page it should
have been showing.
If we're already on a list page, trigger the refresh in popstate as
currently; if not, skip that trigger and rely on the refresh that will
be called in display_around.
An alternative solution would have been to change the refresh in
dispaly_around to use the same debounce as the popstate trigger, which
would fix the issue in that it would only be called once, but introduce
a delay waiting for the end of the debounce time.
Also set use_page when going back to initial state in case that wasn't
the first page of results.