From df707e224ecf871c853ecf873a6df93c311699e9 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 21 Jun 2023 01:33:52 +0800 Subject: [PATCH] remove _hideSort which cause wrong state, let check directly --- flutter/lib/common/widgets/peer_tab_page.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index 30482314a..e84338896 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -41,8 +41,6 @@ EdgeInsets? _menuPadding() { class _PeerTabPageState extends State with SingleTickerProviderStateMixin { - bool _hideSort = gFFI.peerTabModel.currentTab == 0; - final List<_TabEntry> entries = [ _TabEntry( RecentPeersView( @@ -87,7 +85,6 @@ class _PeerTabPageState extends State if (tabIndex < entries.length) { gFFI.peerTabModel.setCurrentTab(tabIndex); entries[tabIndex].load(); - _hideSort = tabIndex == 0; } } @@ -115,7 +112,7 @@ class _PeerTabPageState extends State child: _createPeerViewTypeSwitch(context) .marginOnly(left: 13)), Offstage( - offstage: _hideSort, + offstage: gFFI.peerTabModel.currentTab == 0, child: PeerSortDropdown().marginOnly(left: 8), ), ],