Fix an issue with comment load spinner #1278
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.
Pull Request Description
I've been noticing lately that comment threads have been having a spinner at the bottom, despite having loaded all the comments. I believe this behavior might have regressed as a result of #1107, in which I tweaked the code to fix an issue with deferred comments. I'm not sure if that change broke this case, or really just exposed an unexpected behavior, which is that our
state.commentCount
is greater than thepostView.counts.comments
. I can't explain how that can be, but I think the fix is to consider all the comments loaded if our count is greater than or equal (not just equal).Here is the post I tested with, for reference: https://midwest.social/post/10198542
I will keep an eye out to see whether this fix now regresses the other one!
Issue Being Fixed
Before
comment-issue-before.mp4
After
comment-issue-after.mp4
Issue Number: N/A
Screenshots / Recordings
Checklist
semanticLabel
s where applicable for accessibility?