diff --git a/apps/web/src/app/tools/import-export/export.component.ts b/apps/web/src/app/tools/import-export/export.component.ts index a3e666159e4..1546c9094f4 100644 --- a/apps/web/src/app/tools/import-export/export.component.ts +++ b/apps/web/src/app/tools/import-export/export.component.ts @@ -72,30 +72,23 @@ export class ExportComponent extends BaseExportComponent { ? "FileEncryptedExportWarningDesc" : "encExportKeyWarningDesc"; - try { - const ref = this.modalService.open(UserVerificationPromptComponent, { - allowMultipleModals: true, - data: { - confirmDescription: confirmDescription, - confirmButtonText: "exportVault", - modalTitle: "confirmVaultExport", - }, - }); + const ref = this.modalService.open(UserVerificationPromptComponent, { + allowMultipleModals: true, + data: { + confirmDescription: confirmDescription, + confirmButtonText: "exportVault", + modalTitle: "confirmVaultExport", + }, + }); - if (ref == null) { - return; - } + if (ref == null) { + return; + } - if (await ref.onClosedPromise()) { - //successful - this.submitWithSecretAlreadyVerified(); - } - } catch { - this.platformUtilsService.showToast( - "error", - this.i18nService.t("error"), - this.i18nService.t("invalidMasterPassword") - ); + const userVerified = await ref.onClosedPromise(); + if (userVerified) { + //successful + this.submitWithSecretAlreadyVerified(); } } diff --git a/apps/web/src/app/tools/import-export/import.component.ts b/apps/web/src/app/tools/import-export/import.component.ts index b70171de36e..443f087f306 100644 --- a/apps/web/src/app/tools/import-export/import.component.ts +++ b/apps/web/src/app/tools/import-export/import.component.ts @@ -28,7 +28,6 @@ export class ImportComponent implements OnInit { formPromise: Promise; loading = false; importBlockedByPolicy = false; - protected component = FilePasswordPromptComponent; protected organizationId: string = null; protected successNavigate: any[] = ["vault"]; @@ -244,12 +243,8 @@ export class ImportComponent implements OnInit { ); } - protectedFields() { - return ["TOTP", "Password", "H_Field", "Card Number", "Security Code"]; - } - async showFilePasswordPrompt(fcontents: string, organizationId: string) { - const ref = await this.modalService.open(this.component, { + const ref = await this.modalService.open(FilePasswordPromptComponent, { allowMultipleModals: true, data: { fileContents: fcontents, @@ -264,8 +259,4 @@ export class ImportComponent implements OnInit { const result = await ref.onClosedPromise(); return result === true; } - - async enabled() { - return !this.keyConnectorService.getUsesKeyConnector(); - } } diff --git a/libs/angular/src/components/export.component.ts b/libs/angular/src/components/export.component.ts index 784cc6c49f2..492215e785b 100644 --- a/libs/angular/src/components/export.component.ts +++ b/libs/angular/src/components/export.component.ts @@ -1,11 +1,4 @@ -import { - Directive, - EventEmitter, - OnInit, - Output, - ViewChild, - ViewContainerRef, -} from "@angular/core"; +import { Directive, EventEmitter, OnInit, Output } from "@angular/core"; import { FormBuilder } from "@angular/forms"; import { ModalConfig, ModalService } from "@bitwarden/angular/services/modal.service"; @@ -29,10 +22,6 @@ export class ExportComponent implements OnInit { formPromise: Promise; disabledByPolicy = false; - - @ViewChild("viewUserApiKeyTemplate", { read: ViewContainerRef, static: true }) - viewUserApiKeyModalRef: ViewContainerRef; - encryptionPassword: string; exportForm = this.formBuilder.group({