show error when incorrect backup password was provided
This commit is contained in:
Binary file not shown.
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user