add more error handling and messaging when there are bad DB errors

This commit is contained in:
2025-05-23 12:35:16 -06:00
parent 5b6c59c232
commit 1129a13e20
4 changed files with 114 additions and 31 deletions

View File

@@ -618,6 +618,7 @@
leave-to-class="opacity-0"
>
<div v-if="showContactImport()" class="mt-4">
<!-- Bulk import has an error
<div class="flex justify-center">
<button
class="block text-center text-md bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mb-6"
@@ -628,6 +629,7 @@
(which doesn't include Identifier Data)
</button>
</div>
-->
<div class="flex justify-center">
<button
class="block text-center text-md bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mb-6"
@@ -1623,7 +1625,7 @@ export default class AccountViewView extends Vue {
async submitImportFile() {
if (inputImportFileNameRef.value != null) {
await db.delete()
.then(async () => {
.then(async (x) => {
await Dexie.import(inputImportFileNameRef.value as Blob, {
progressCallback: this.progressCallback,
})
@@ -1635,9 +1637,9 @@ export default class AccountViewView extends Vue {
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.",
text: "There was an error in the import. Your identities and contacts may have been affected, so you may have to restore your identifier and use the contact import method.",
},
5000,
-1,
);
});
}