Skip to content

Commit

Permalink
add comemnt
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <[email protected]>
  • Loading branch information
fufesou committed Oct 27, 2023
1 parent 8cc9e30 commit de35630
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 de35630

Please sign in to comment.