client: Restore “Mark all” button to 2.18 behaviour #1460
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.
In 2.18, when in “unread” mode, if there were no unread items, clicking the button would clear out all items and trigger a reload or refresh status of the “Load more” button, depending on whether the client was aware of more unread items on the server.
When we ported entries to React in f3b279c, we accidentally broke the “Mark all as read” button, making it keep all the items it marked in the view (a). We also did not port the code that would load more items afterwards (b).
It got further broken during porting routing to React in 405a3ec. We looked for the
filter
field on a wrong object (c).We fixed (c) and attempted to fix (a) in ec544b7 but the patch just made it keep all the items it did not mark, such as those marked as read manually beforehand, instead.
This patch makes it so that the button removes all the items in the view except for the active item and loads more items afterwards, returning to behaviour similar to 2.18.