Skip to content

Commit

Permalink
Merge pull request #46 from decentralized-identity/fix/duplicate-contact
Browse files Browse the repository at this point in the history
fix: Only add new contact if it doesn't already exist
  • Loading branch information
dbluhm committed Oct 5, 2023
2 parents e5e1241 + 2cbfc8e commit cd61efc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/profile/messaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class ContactListComponent

async onAddContact() {
if (this.newContact.did) {
ContactService.addContact(this.newContact as Contact)
if (!ContactService.getContact(this.newContact.did))
ContactService.addContact(this.newContact as Contact)
this.contacts = ContactService.getContacts()
this.isModalOpen = false
agent.sendProfile(this.newContact as Contact)
Expand Down

0 comments on commit cd61efc

Please sign in to comment.