Browse Source

refine error message when duplicate contact is input

starred-projects
Trent Larson 9 months ago
parent
commit
11070755d6
  1. 9
      src/views/ContactsView.vue

9
src/views/ContactsView.vue

@ -587,12 +587,19 @@ export default class ContactsView extends Vue {
}) })
.catch((err) => { .catch((err) => {
console.error("Error when adding contact to storage:", err); console.error("Error when adding contact to storage:", err);
let message = "An error prevented this import.";
if (
err.message?.indexOf("Key already exists in the object store.") > -1
) {
message =
"A contact with that DID is already in your contact list. Edit them directly below.";
}
this.$notify( this.$notify(
{ {
group: "alert", group: "alert",
type: "danger", type: "danger",
title: "Contact Not Added", title: "Contact Not Added",
text: "An error prevented this import.", text: message,
}, },
-1, -1,
); );

Loading…
Cancel
Save