Components/delete-modal: fix

This commit is contained in:
Toast 2025-02-05 01:12:56 +01:00
parent d1fd09ab75
commit d9a26a6645

View file

@ -33,10 +33,11 @@ export class DeleteModalComponent {
deletePressed() { deletePressed() {
const regex = new RegExp(this.showName)
const control = new FormControl("", [Validators.required, Validators.pattern(regex)])
this.confirmationForm.setControl("name", control)
if (this.formHidden) { if (this.formHidden) {
// Only add the control the first time the button is pressed
const regex = new RegExp(this.showName)
const control = new FormControl("", [Validators.required, Validators.pattern(regex)])
this.confirmationForm.setControl("name", control)
this.formHidden = false; this.formHidden = false;
this.buttonDisabled = true; this.buttonDisabled = true;
} else { } else {