show error when incorrect backup password was provided

This commit is contained in:
marlon-erler
2026-09-05 02:32:27 +02:00
parent e4d162f0ab
commit b7d85510d5
5 changed files with 5 additions and 5 deletions
Binary file not shown.
+1 -1
View File
@@ -93,7 +93,7 @@ export default class FileTransferModel {
const parsed = parse(decrypted);
if (!Array.isArray(parsed)) {
console.error("Canceling backup - not an array", decrypted);
return;
throw "no array";
}
for (const file of parsed) {
+1 -1
View File
@@ -928,7 +928,7 @@ function ImportDecryptionDataModal(
class="primary flex"
on:click={fileTransferViewModel.decryptImport}
toggle:disabled={
fileTransferViewModel.cannotDecryptImport
fileTransferViewModel.importDecryptSuccessful
}
>
{
Binary file not shown.
@@ -86,7 +86,7 @@ export default class FileTransferViewModel extends Context {
[this.importedFile],
() => this.importedFile.value == undefined,
);
cannotDecryptImport: React.State<boolean> = React.createProxyState(
importDecryptSuccessful: React.State<boolean> = React.createProxyState(
[this.importKey],
() => this.importKey.value == "",
);
@@ -179,7 +179,7 @@ export default class FileTransferViewModel extends Context {
const key = this.importKey.value;
if (!fileString || !key) return;
this.cannotDecryptImport.value = true;
this.importDecryptSuccessful.value = true;
try {
await this.coreViewModel.fileTransferModel.handleBackupFile(
fileString,
@@ -189,7 +189,7 @@ export default class FileTransferViewModel extends Context {
} catch (e) {
console.error(e);
this.isImportKeyCorrect.value = false;
this.cannotDecryptImport.value = false;
this.importDecryptSuccessful.value = false;
}
};