Fix next discussion jumps to first after resolving a discussion
app/assets/javascripts/notes/stores/getters.js
nextUnresolvedDiscussionId is looking for the current discussion id in one of the unresolvedDiscussionsIds array. Since it the current discussion has been resolved it will return -1 and start over at the beginning.
Suggest searching through all discussions if -1 is returned and dissussionId is provided.
The following discussion from gitlab-ce!30144 should be addressed:
-
@pslaughter started a discussion: issue: When a discussion is unresolved, it and I use keyboard navigation, it always starts me over at the beginning.
20190805_keyboard_next_discussion_after_resolve
I think this has to do with the
nextUnresolvedDiscussionIdgetters requiring that theidpassed to it exists in the unresolved array🤔 ...On one hand, it could be troublesome making these getters work with resolved ID's, so I can understand handling this in a follow up MR. On the other hand, it's a pretty frustrating behavior for users wanting to cycle through discussions, and we may be best to handle it here
🤔 ...What do you think?