diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 2efff7e1..c944e847 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -976,6 +976,7 @@ import { AxiosError } from "axios"; import { Buffer } from "buffer/"; import Dexie from "dexie"; import "dexie-export-import"; +// @ts-ignore - they aren't exporting it but it's there import { ImportProgress } from "dexie-export-import"; import { LeafletMouseEvent } from "leaflet"; import * as R from "ramda"; @@ -1621,10 +1622,24 @@ export default class AccountViewView extends Vue { */ async submitImportFile() { if (inputImportFileNameRef.value != null) { - await db.delete(); - await Dexie.import(inputImportFileNameRef.value as Blob, { - progressCallback: this.progressCallback, - }); + await db.delete() + .then(async () => { + await Dexie.import(inputImportFileNameRef.value as Blob, { + progressCallback: this.progressCallback, + }) + }) + .catch((error) => { + logger.error("Error importing file:", error); + this.$notify( + { + group: "alert", + type: "danger", + title: "Error Importing", + text: "There was an error importing that file. Your contacts may have been affected, so you may want to use the other import method.", + }, + 5000, + ); + }); } }