diff --git a/src/views/ContactQRScanShowView.vue b/src/views/ContactQRScanShowView.vue index ffe2d767..d9b5be8c 100644 --- a/src/views/ContactQRScanShowView.vue +++ b/src/views/ContactQRScanShowView.vue @@ -574,6 +574,26 @@ export default class ContactQRScanShow extends Vue { try { logger.info("Opening database connection for new contact"); await db.open(); + + // Check if contact already exists + const existingContacts = await db.contacts.toArray(); + const existingContact = existingContacts.find(c => c.did === contact.did); + + if (existingContact) { + logger.info("Contact already exists", { did: contact.did }); + this.$notify( + { + group: "alert", + type: "warning", + title: "Contact Exists", + text: "This contact has already been added to your list.", + }, + 3000, + ); + return; + } + + // Add new contact await db.contacts.add(contact); if (this.activeDid) {