1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-05 11:13:44 +00:00

use observable as an Output

This commit is contained in:
Nick Krantz
2025-08-19 14:35:53 -05:00
parent 5bb5243c55
commit dacbd9dc16
2 changed files with 2 additions and 6 deletions

View File

@@ -16,7 +16,7 @@
[submitBtn]="submitBtn"
(formReady)="onFormReady()"
(cipherSaved)="onCipherSaved($event)"
(onFormStatusChange)="formStatusChanged($event)"
(formStatusChange$)="formStatusChanged($event)"
>
<bit-item slot="attachment-button">
<button

View File

@@ -112,13 +112,11 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci
@Output() formReady = this.formReadySubject.asObservable();
@Output() onFormStatusChange = new EventEmitter<"enabled" | "disabled">();
/**
* Emitted when the form is enabled
*/
private formStatusChangeSubject = new Subject<"enabled" | "disabled">();
formStatusChange$ = this.formStatusChangeSubject.asObservable();
@Output() formStatusChange$ = this.formStatusChangeSubject.asObservable();
/**
* The original cipher being edited or cloned. Null for add mode.
@@ -161,13 +159,11 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci
disableFormFields(): void {
this.cipherForm.disable({ emitEvent: false });
this.formStatusChangeSubject.next("disabled");
this.onFormStatusChange.emit("disabled");
}
enableFormFields(): void {
this.cipherForm.enable({ emitEvent: false });
this.formStatusChangeSubject.next("enabled");
this.onFormStatusChange.emit("enabled");
}
/**