chore: show alert when deleting contact belonging to an owned vault

This commit is contained in:
Aman Harwara
2023-09-21 13:29:16 +05:30
parent 062e50e901
commit bd1310b1fc

View File

@@ -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])