From bd1310b1fc65fcaf2b16a834bda08508f1e95f90 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Thu, 21 Sep 2023 13:29:16 +0530 Subject: [PATCH] chore: show alert when deleting contact belonging to an owned vault --- .../Preferences/Panes/Vaults/Contacts/ContactItem.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Contacts/ContactItem.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Contacts/ContactItem.tsx index 008e08ea9..7437cde2b 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Contacts/ContactItem.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Contacts/ContactItem.tsx @@ -22,7 +22,14 @@ const ContactItem = ({ contact }: Props) => { const deleteContact = useCallback(async () => { if (await application.alerts.confirm('Are you sure you want to delete this contact?')) { - void application.contacts.deleteContact(contact) + const result = await application.contacts.deleteContact(contact) + if (result.isFailed()) { + application.alerts + .alertV2({ + text: result.getError(), + }) + .catch(console.error) + } } }, [application.alerts, application.contacts, contact])