mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
fix send text details component
This commit is contained in:
@@ -50,6 +50,15 @@ export class SendTextDetailsComponent implements OnInit {
|
|||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
protected sendFormContainer: SendFormContainer,
|
protected sendFormContainer: SendFormContainer,
|
||||||
) {
|
) {
|
||||||
|
this.baseSendTextDetailsForm = this.formBuilder.group({
|
||||||
|
text: new FormControl("", Validators.required),
|
||||||
|
hidden: new FormControl(false),
|
||||||
|
});
|
||||||
|
|
||||||
|
this.sendTextDetailsForm = Object.assign(this.baseSendTextDetailsForm, this.sendDetailsForm);
|
||||||
|
|
||||||
|
this.sendFormContainer.registerChildForm("sendTextDetailsForm", this.sendTextDetailsForm);
|
||||||
|
|
||||||
this.sendTextDetailsForm.valueChanges.pipe(takeUntilDestroyed()).subscribe((value) => {
|
this.sendTextDetailsForm.valueChanges.pipe(takeUntilDestroyed()).subscribe((value) => {
|
||||||
this.sendFormContainer.patchSend((send) => {
|
this.sendFormContainer.patchSend((send) => {
|
||||||
return Object.assign(send, {
|
return Object.assign(send, {
|
||||||
@@ -63,15 +72,6 @@ export class SendTextDetailsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.baseSendTextDetailsForm = this.formBuilder.group({
|
|
||||||
text: new FormControl("", Validators.required),
|
|
||||||
hidden: new FormControl(false),
|
|
||||||
});
|
|
||||||
|
|
||||||
this.sendTextDetailsForm = Object.assign(this.baseSendTextDetailsForm, this.sendDetailsForm);
|
|
||||||
|
|
||||||
this.sendFormContainer.registerChildForm("sendTextDetailsForm", this.sendTextDetailsForm);
|
|
||||||
|
|
||||||
if (this.originalSendView) {
|
if (this.originalSendView) {
|
||||||
this.baseSendTextDetailsForm.patchValue({
|
this.baseSendTextDetailsForm.patchValue({
|
||||||
text: this.originalSendView.text?.text || "",
|
text: this.originalSendView.text?.text || "",
|
||||||
|
|||||||
Reference in New Issue
Block a user