From 8507097fe7e50a80288a0a55b4e2039e23adce63 Mon Sep 17 00:00:00 2001 From: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com> Date: Tue, 24 Sep 2024 02:45:08 -0700 Subject: [PATCH] fix send password input (#11208) --- .../send-form/components/options/send-options.component.ts | 2 +- .../send-ui/src/send-form/components/send-form.component.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/tools/send/send-ui/src/send-form/components/options/send-options.component.ts b/libs/tools/send/send-ui/src/send-form/components/options/send-options.component.ts index ab4ffaa9dd..89ab9d19ba 100644 --- a/libs/tools/send/send-ui/src/send-form/components/options/send-options.component.ts +++ b/libs/tools/send/send-ui/src/send-form/components/options/send-options.component.ts @@ -102,7 +102,7 @@ export class SendOptionsComponent implements OnInit { this.sendOptionsForm.patchValue({ maxAccessCount: this.sendFormContainer.originalSendView.maxAccessCount, accessCount: this.sendFormContainer.originalSendView.accessCount, - password: this.sendFormContainer.originalSendView.password, + password: null, hideEmail: this.sendFormContainer.originalSendView.hideEmail, notes: this.sendFormContainer.originalSendView.notes, }); diff --git a/libs/tools/send/send-ui/src/send-form/components/send-form.component.ts b/libs/tools/send/send-ui/src/send-form/components/send-form.component.ts index b265b644df..1d93804e11 100644 --- a/libs/tools/send/send-ui/src/send-form/components/send-form.component.ts +++ b/libs/tools/send/send-ui/src/send-form/components/send-form.component.ts @@ -16,6 +16,7 @@ import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { FormBuilder, ReactiveFormsModule } from "@angular/forms"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; +import { Utils } from "@bitwarden/common/platform/misc/utils"; import { SendType } from "@bitwarden/common/tools/send/enums/send-type"; import { SendView } from "@bitwarden/common/tools/send/models/view/send.view"; import { @@ -199,6 +200,10 @@ export class SendFormComponent implements AfterViewInit, OnInit, OnChanges, Send return; } + if (Utils.isNullOrWhitespace(this.updatedSendView.password)) { + this.updatedSendView.password = null; + } + await this.addEditFormService.saveSend(this.updatedSendView, this.file, this.config); this.toastService.showToast({