chore: confirm before deleting contact

This commit is contained in:
Aman Harwara
2023-08-09 14:52:26 +05:30
parent 4fd9402940
commit 1b95a15350

View File

@@ -19,8 +19,10 @@ const ContactItem = ({ contact }: Props) => {
const collaborationID = application.contacts.getCollaborationIDForTrustedContact(contact)
const deleteContact = useCallback(async () => {
void application.contacts.deleteContact(contact)
}, [application.contacts, contact])
if (await application.alerts.confirm('Are you sure you want to delete this contact?')) {
void application.contacts.deleteContact(contact)
}
}, [application.alerts, application.contacts, contact])
return (
<>