mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
remove comments
This commit is contained in:
@@ -48,7 +48,6 @@ export class BaseSendDetailsComponent implements OnInit {
|
|||||||
protected i18nService: I18nService,
|
protected i18nService: I18nService,
|
||||||
protected datePipe: DatePipe,
|
protected datePipe: DatePipe,
|
||||||
) {
|
) {
|
||||||
// Initialize the form
|
|
||||||
this.sendDetailsForm = this.formBuilder.group({
|
this.sendDetailsForm = this.formBuilder.group({
|
||||||
name: new FormControl("", Validators.required),
|
name: new FormControl("", Validators.required),
|
||||||
selectedDeletionDatePreset: new FormControl(DatePreset.SevenDays || "", Validators.required),
|
selectedDeletionDatePreset: new FormControl(DatePreset.SevenDays || "", Validators.required),
|
||||||
|
|||||||
@@ -50,10 +50,8 @@ export class SendTextDetailsComponent implements OnInit {
|
|||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
protected sendFormContainer: SendFormContainer,
|
protected sendFormContainer: SendFormContainer,
|
||||||
) {
|
) {
|
||||||
// Subscribe to form value changes and update the parent SendView accordingly
|
|
||||||
this.sendTextDetailsForm.valueChanges.pipe(takeUntilDestroyed()).subscribe((value) => {
|
this.sendTextDetailsForm.valueChanges.pipe(takeUntilDestroyed()).subscribe((value) => {
|
||||||
this.sendFormContainer.patchSend((send) => {
|
this.sendFormContainer.patchSend((send) => {
|
||||||
// Update the send object with the form values
|
|
||||||
return Object.assign(send, {
|
return Object.assign(send, {
|
||||||
text: {
|
text: {
|
||||||
text: value.text,
|
text: value.text,
|
||||||
@@ -65,7 +63,6 @@ export class SendTextDetailsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
// Define the nested form group for `text`
|
|
||||||
this.baseSendTextDetailsForm = this.formBuilder.group({
|
this.baseSendTextDetailsForm = this.formBuilder.group({
|
||||||
text: new FormControl("", Validators.required),
|
text: new FormControl("", Validators.required),
|
||||||
hidden: new FormControl(false),
|
hidden: new FormControl(false),
|
||||||
@@ -73,10 +70,8 @@ export class SendTextDetailsComponent implements OnInit {
|
|||||||
|
|
||||||
this.sendTextDetailsForm = Object.assign(this.baseSendTextDetailsForm, this.sendDetailsForm);
|
this.sendTextDetailsForm = Object.assign(this.baseSendTextDetailsForm, this.sendDetailsForm);
|
||||||
|
|
||||||
// Register this form with the parent form
|
|
||||||
this.sendFormContainer.registerChildForm("sendTextDetailsForm", this.sendTextDetailsForm);
|
this.sendFormContainer.registerChildForm("sendTextDetailsForm", this.sendTextDetailsForm);
|
||||||
|
|
||||||
// If editing or cloning an existing SendView, populate the form
|
|
||||||
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