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);
|
const parsed = parse(decrypted);
|
||||||
if (!Array.isArray(parsed)) {
|
if (!Array.isArray(parsed)) {
|
||||||
console.error("Canceling backup - not an array", decrypted);
|
console.error("Canceling backup - not an array", decrypted);
|
||||||
return;
|
throw "no array";
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const file of parsed) {
|
for (const file of parsed) {
|
||||||
|
|||||||
@@ -928,7 +928,7 @@ function ImportDecryptionDataModal(
|
|||||||
class="primary flex"
|
class="primary flex"
|
||||||
on:click={fileTransferViewModel.decryptImport}
|
on:click={fileTransferViewModel.decryptImport}
|
||||||
toggle:disabled={
|
toggle:disabled={
|
||||||
fileTransferViewModel.cannotDecryptImport
|
fileTransferViewModel.importDecryptSuccessful
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
@@ -86,7 +86,7 @@ export default class FileTransferViewModel extends Context {
|
|||||||
[this.importedFile],
|
[this.importedFile],
|
||||||
() => this.importedFile.value == undefined,
|
() => this.importedFile.value == undefined,
|
||||||
);
|
);
|
||||||
cannotDecryptImport: React.State<boolean> = React.createProxyState(
|
importDecryptSuccessful: React.State<boolean> = React.createProxyState(
|
||||||
[this.importKey],
|
[this.importKey],
|
||||||
() => this.importKey.value == "",
|
() => this.importKey.value == "",
|
||||||
);
|
);
|
||||||
@@ -179,7 +179,7 @@ export default class FileTransferViewModel extends Context {
|
|||||||
const key = this.importKey.value;
|
const key = this.importKey.value;
|
||||||
if (!fileString || !key) return;
|
if (!fileString || !key) return;
|
||||||
|
|
||||||
this.cannotDecryptImport.value = true;
|
this.importDecryptSuccessful.value = true;
|
||||||
try {
|
try {
|
||||||
await this.coreViewModel.fileTransferModel.handleBackupFile(
|
await this.coreViewModel.fileTransferModel.handleBackupFile(
|
||||||
fileString,
|
fileString,
|
||||||
@@ -189,7 +189,7 @@ export default class FileTransferViewModel extends Context {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
this.isImportKeyCorrect.value = false;
|
this.isImportKeyCorrect.value = false;
|
||||||
this.cannotDecryptImport.value = false;
|
this.importDecryptSuccessful.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user