Skip to content

Commit

Permalink
Merge pull request rustdesk#6194 from fufesou/fix/comments_infinite_loop
Browse files Browse the repository at this point in the history
add comemnt
  • Loading branch information
rustdesk authored Oct 27, 2023
2 parents 8cc9e30 + de35630 commit 8a2bd1c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion flutter/lib/common/widgets/peers_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,13 @@ class _PeersViewState extends State<_PeersView> with WindowListener {
child: widget.peerCardBuilder(peer),
);
final windowWidth = MediaQuery.of(context).size.width;
final currentTab = gFFI.peerTabModel.currentTab;
// `Provider.of<PeerTabModel>(context)` will causes infinete loop.
// Because `gFFI.peerTabModel.setCurrentTabCachedPeers(peers)` will trigger `notifyListeners()`.
//
// No need to listen the currentTab change event.
// Because the currentTab change event will trigger the peers change event,
// and the peers change event will trigger _buildPeersView().
final currentTab = Provider.of<PeerTabModel>(context, listen: false).currentTab;
final hideAbTagsPanel = bind.mainGetLocalOption(key: "hideAbTagsPanel").isNotEmpty;
return isDesktop
? Obx(
Expand Down

0 comments on commit 8a2bd1c

Please sign in to comment.