Abort share fetches if the current user has changed #118
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.
Add a
resetRequired
flag to override the current fetch request and reset if the current user has changed while the request is being made. If the component is not fetching, and has already been populated, reset as normal. This feels slightly clumsy, but corrects an issue where users were being shown the shares of other users, or concatenations of user shares because theuserId
was only updating when the fetch request was already in progress. Setting aresetRequired
flag allows the results of the existing request to be ignored, and a new request made with the updated user details.Should fix this bug: https://trello.com/c/5v4YpJjr/452-first-time-going-in-on-a-user-who-does-not-have-any-pixel-kit-shares-you-see-other-peoples-pixel-kit-shares