Wait for the radio before removing a contact, and explain re-adds
removeContact now waits for the radio's reply and only drops the contact locally when the radio confirms (or reports it doesn't have it), so a lost command no longer leaves a contact that the next sync restores. Failures are shown to the user. The delete dialog warns when the radio auto-adds that contact type, since the contact returns on its next advert.
This commit is contained in:
1 parent
1e786b24ba
commit
f2a27f0f71
28 files changed
+352
-10
No files matched your search
@@ -316,7 +316,15 @@ class _DiscoveryScreenState extends State<DiscoveryScreen> {
|
||||
content: Text(context.l10n.discoveredContacts_contactAdded),
|
||||
action: SnackBarAction(
|
||||
label: context.l10n.common_undo,
|
||||
onPressed: () => connector.removeContact(contact),
|
||||
onPressed: () => unawaited(
|
||||
connector.removeContact(contact).catchError((Object _) {
|
||||
if (!context.mounted) return;
|
||||
showDismissibleSnackBar(
|
||||
context,
|
||||
content: Text(context.l10n.contacts_removeFailed),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
} catch (_) {
|
||||
|
||||
Reference in new issue
Block a user