ab: opt reaction and message hint

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-08-16 10:18:29 +08:00
parent 553a3798a1
commit 1e75b172d6
4 changed files with 85 additions and 32 deletions

View File

@@ -343,12 +343,17 @@ class _PeerTabPageState extends State<PeerTabPage>
}
}
gFFI.abModel.deletePeers(peers.map((p) => p.id).toList());
await gFFI.abModel.pushAb();
final future = gFFI.abModel.pushAb();
if (hasSynced) {
Future.delayed(Duration(seconds: 2), () {
BotToast.showText(
contentColor: Colors.lightBlue,
text: translate('synced_peer_readded_tip'));
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'));
}
});
}
}
@@ -357,7 +362,7 @@ class _PeerTabPageState extends State<PeerTabPage>
break;
}
gFFI.peerTabModel.setMultiSelectionMode(false);
showToast(translate('Successful'));
if (model.currentTab != 3) showToast(translate('Successful'));
}
deletePeerConfirmDialog(onSubmit, translate('Delete'));
@@ -404,7 +409,6 @@ class _PeerTabPageState extends State<PeerTabPage>
gFFI.abModel.addPeers(peers);
gFFI.abModel.pushAb();
model.setMultiSelectionMode(false);
showToast(translate('Successful'));
},
child: Tooltip(
message: translate('Add to Address Book'),