From 15949ed8bc264b1bdfd5fbc4da53a323fec5baeb Mon Sep 17 00:00:00 2001 From: CarleyDiaz-Bitwarden <103955722+CarleyDiaz-Bitwarden@users.noreply.github.com> Date: Mon, 20 Jun 2022 14:56:57 -0400 Subject: [PATCH] Updates to error handling --- .../export-file-password-prompt.component.html | 2 +- .../components/file-password-prompt.component.html | 2 +- apps/web/src/app/tools/import.component.ts | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/components/export-file-password-prompt.component.html b/apps/web/src/app/components/export-file-password-prompt.component.html index 0f31451e01e..c5de28156c7 100644 --- a/apps/web/src/app/components/export-file-password-prompt.component.html +++ b/apps/web/src/app/components/export-file-password-prompt.component.html @@ -5,7 +5,7 @@ -

{{ modalTitle | i18n }}

diff --git a/apps/web/src/app/components/file-password-prompt.component.html b/apps/web/src/app/components/file-password-prompt.component.html index 4c98ef66833..3a2ff6f27d3 100644 --- a/apps/web/src/app/components/file-password-prompt.component.html +++ b/apps/web/src/app/components/file-password-prompt.component.html @@ -5,7 +5,7 @@ -

{{ "confirmVaultImport" | i18n }}

diff --git a/apps/web/src/app/tools/import.component.ts b/apps/web/src/app/tools/import.component.ts index 00977522877..36917a20277 100644 --- a/apps/web/src/app/tools/import.component.ts +++ b/apps/web/src/app/tools/import.component.ts @@ -114,12 +114,16 @@ export class ImportComponent implements OnInit { if (error != null) { //Check if the error is that a password is required if (error.passwordRequired) { - if (await this.promptPassword(fileContents)) { + if (await this.promptFilePassword(fileContents)) { //successful } else { - //failed - this.error(error); //TODO different error + //failed - File Password issues this.loading = false; + this.platformUtilsService.showToast( + "error", + this.i18nService.t("error"), + this.i18nService.t("invalidMasterPassword") + ); return; } } else { @@ -139,7 +143,7 @@ export class ImportComponent implements OnInit { this.loading = false; } - private async promptPassword(fcontents: string) { + private async promptFilePassword(fcontents: string) { return await this.filePasswordPromptService.showPasswordPrompt(fcontents, this.organizationId); }