add force, quiet to pullAb, no force pull while switch tab, this may be

not good, because data not updated, have to do with refresh button, we
may change to quiet pull in the future
This commit is contained in:
rustdesk
2023-06-23 15:10:10 +08:00
parent 977ac2a3b2
commit 58e4d66b44
4 changed files with 24 additions and 29 deletions

View File

@@ -22,7 +22,7 @@ class PeerTabPage extends StatefulWidget {
class _TabEntry {
final Widget widget;
final Function() load;
final Function({dynamic hint}) load;
_TabEntry(this.widget, this.load);
}
@@ -52,12 +52,12 @@ class _PeerTabPageState extends State<PeerTabPage>
AddressBook(
menuPadding: _menuPadding(),
),
() => gFFI.abModel.pullAb()),
({dynamic hint}) => gFFI.abModel.pullAb(force: hint == null)),
_TabEntry(
MyGroup(
menuPadding: _menuPadding(),
),
() => gFFI.groupModel.pull(),
({dynamic hint}) => gFFI.groupModel.pull(force: hint == null),
),
];
@@ -75,7 +75,7 @@ class _PeerTabPageState extends State<PeerTabPage>
Future<void> handleTabSelection(int tabIndex) async {
if (tabIndex < entries.length) {
gFFI.peerTabModel.setCurrentTab(tabIndex);
entries[tabIndex].load();
entries[tabIndex].load(hint: false);
}
}