qaul / qaul.net

Internet Independent Wireless Mesh Communication App
https://qaul.net
GNU Affero General Public License v3.0
511 stars 62 forks source link

Fix: network view flicker #632

Closed brenodt closed 3 months ago

brenodt commented 3 months ago

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.

MathJud commented 3 months ago

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