forked from jsnbuchanan/crowd-funder-for-time-pwa
refine error message when duplicate contact is input
This commit is contained in:
@@ -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,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user