mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
opt pull ab (#7508)
1. Test legacy/new mode only upon logging out. 2. Avoid pulling all data unnecessarily: * On startup: Retrieve list, current, and personal data. * On refresh: Retrieve list and current data. * On changing AB/switching tabs: Attempt to pull current data if not initialized. 3. Cache only personal and current AB. 4. Synchronize current AB from recent. 5. Remove AB loading CircularProgressIndicator. Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -46,12 +46,6 @@ class _AddressBookState extends State<AddressBook> {
|
||||
child: ElevatedButton(
|
||||
onPressed: loginDialog, child: Text(translate("Login"))));
|
||||
} else {
|
||||
if (gFFI.abModel.currentAbLoading.value &&
|
||||
gFFI.abModel.currentAbEmtpy) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
return Column(
|
||||
children: [
|
||||
buildErrorBanner(context,
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hbb/common/widgets/dialog.dart';
|
||||
import 'package:flutter_hbb/consts.dart';
|
||||
import 'package:flutter_hbb/models/ab_model.dart';
|
||||
import 'package:flutter_hbb/models/peer_tab_model.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -1059,9 +1060,11 @@ class AddressBookPeerCard extends BasePeerCard {
|
||||
return menuItems;
|
||||
}
|
||||
|
||||
// address book does not need to update
|
||||
@protected
|
||||
@override
|
||||
void _update() => gFFI.abModel.pullAb(quiet: true);
|
||||
void _update() =>
|
||||
{}; //gFFI.abModel.pullAb(force: ForcePullAb.current, quiet: true);
|
||||
|
||||
@protected
|
||||
MenuEntryBase<String> _editTagAction(String id) {
|
||||
|
||||
@@ -62,7 +62,9 @@ class _PeerTabPageState extends State<PeerTabPage>
|
||||
AddressBook(
|
||||
menuPadding: _menuPadding(),
|
||||
),
|
||||
({dynamic hint}) => gFFI.abModel.pullAb(force: hint == null)),
|
||||
({dynamic hint}) => gFFI.abModel.pullAb(
|
||||
force: hint == null ? ForcePullAb.listAndCurrent : null,
|
||||
quiet: false)),
|
||||
_TabEntry(
|
||||
MyGroup(
|
||||
menuPadding: _menuPadding(),
|
||||
|
||||
Reference in New Issue
Block a user