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

[#576] Fix block user dialog flow #618

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Conversation

brenodt
Copy link
Collaborator

@brenodt brenodt commented Apr 4, 2024

Description

The bug here was quite simple: the pop callback was being invoked with the parent's context.

Flutter uses the navigation stack to know what to pop. Whenever we invoke it via Navigator.pop(context), it uses the context to derive where in the stack the method is being invoked and act accordingly.

By using the wrong context, the dialog was not being disposed of, and neither was it returning the value of the confirmation, effectively meaning the user wasn't being blocked.

With the changes done here, the feature is back to a working state: user is blocked, their messages being filtered out.

However, as described in #576, I do think that it would be useful to have more control over blocked user management:

  • a place to see users previously blocked (giving the user the option to unblock)
  • option to show/hide chats from blocked users
  • option to show/hide public posts from blocked users

What do you think, @MathJud ?

In any case, it's not a blocker to land this fix!

Before

before.mp4

After

after.mp4

The bug here was quite simple: the `pop` callback was being invoked with the parent's `context`.

Flutter uses the navigation stack to know what to `pop`. Whenever we invoke it via `Navigator.pop(context)`, it uses the `context` to derive where the method is being invoked and act accordingly.

By using the wrong `context`, the dialog was not being disposed of, and neither was it returning the value of the confirmation, effectively meaning the user wasn't being blocked.
@brenodt brenodt requested a review from MathJud April 4, 2024 22:41
@brenodt brenodt self-assigned this Apr 4, 2024
@MathJud MathJud merged commit 2bcb906 into main Apr 8, 2024
4 checks passed
@MathJud MathJud deleted the fix/576-block-user-dialog branch April 8, 2024 10:49
@github-actions github-actions bot locked and limited conversation to collaborators Apr 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants