Merge pull request #5425 from 21pages/ab

fix searching alias doesn't take effect in address book
This commit is contained in:
RustDesk
2023-08-17 19:24:13 +08:00
committed by GitHub
5 changed files with 42 additions and 30 deletions

View File

@@ -212,6 +212,14 @@ class AbModel {
it.first.alias = alias;
}
void unrememberPassword(String id) {
final it = peers.where((element) => element.id == id);
if (it.isEmpty) {
return;
}
it.first.hash = '';
}
Future<bool> pushAb(
{bool toastIfFail = true,
bool toastIfSucc = true,
@@ -508,4 +516,17 @@ class AbModel {
throw err;
}
}
reSyncToast(Future<bool> future) {
if (!shouldSyncAb()) return;
Future.delayed(Duration.zero, () async {
final succ = await future;
if (succ) {
await Future.delayed(Duration(seconds: 2)); // success msg
BotToast.showText(
contentColor: Colors.lightBlue,
text: translate('synced_peer_readded_tip'));
}
});
}
}