Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh comments when a user is blocked #1886

Merged
merged 2 commits into from Nov 20, 2023
Merged

Conversation

ifosli
Copy link
Contributor

@ifosli ifosli commented Nov 16, 2023

πŸ“² What

If a user is blocked, comments are reset - refetched and the user is jumped back to top. If a user is blocked from the CommentRepliesViewController, they're navigated back to the main CommentsViewController.

Note: I did consider refetching comments in place instead, but getting it to work with pagination seemed tricky, so I'm clearing state instead for now. If we have time, it would be nice to revisit this approach and try to let the user keep their place in our comments.

πŸ‘€ See

Jira

βœ… Acceptance criteria

  • Comment state is reset when a user is successfully blocked (from the commentsViewController or the CommentRepliesViewController)

@ifosli ifosli self-assigned this Nov 16, 2023
Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (ae907e4) 83.75% compared to head (ebc990c) 83.74%.

Files Patch % Lines
...nts/Controllers/CommentRepliesViewController.swift 11.11% 8 Missing ⚠️
.../Comments/Controllers/CommentsViewController.swift 11.11% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1886      +/-   ##
==========================================
- Coverage   83.75%   83.74%   -0.01%     
==========================================
  Files        1222     1222              
  Lines      111429   111444      +15     
  Branches    29638    29644       +6     
==========================================
+ Hits        93323    93325       +2     
- Misses      17089    17102      +13     
  Partials     1017     1017              

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@@ -166,14 +172,16 @@ final class CommentRepliesViewController: UITableViewController, MessageBannerVi
self.viewModel.outputs.userBlocked
.observeForUI()
.observeValues { [weak self] success in
self?.commentComposer.isHidden = true
guard let self else { return }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, nice shortcut. Didn't know you could do that πŸ‘

Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘ lgtm

@amy-at-kickstarter amy-at-kickstarter merged commit 235c6ae into main Nov 20, 2023
6 checks passed
@amy-at-kickstarter amy-at-kickstarter deleted the refreshComments branch November 20, 2023 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants