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

Fix: network view flicker #632

Closed
wants to merge 1 commit into from
Closed

Fix: network view flicker #632

wants to merge 1 commit into from

Conversation

brenodt
Copy link
Collaborator

@brenodt brenodt commented Jun 7, 2024

Description

The cause of this behavior resided in the qaul_rpc package, which exposes a StateNotifier<List<User>>.

On every second, we refresh the users list, so that the UI can be notified in case of new users or state changes for existing users.

This was causing the UI to re-render, since the list of users changed on every second (i.e. the object changed, not the actual list of users).

A state change notifies the UI to trigger a re-render, which is perceived as a flicker.

This is solved by not updating the notifier's state when it and the new list of users are deeply equal.

@brenodt brenodt requested a review from MathJud June 7, 2024 15:32
@brenodt brenodt self-assigned this Jun 7, 2024
@MathJud
Copy link
Member

MathJud commented Jun 8, 2024

Thanks a lot! It works great!
This PR was merged into the libp2p53 branch and merged there :)
I'm therefor closing the PR here.

@MathJud MathJud closed this Jun 8, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 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