Added checks for non-dirty forms when saving/adding.

This commit is contained in:
Tom 2025-04-02 16:35:41 +00:00
parent 1e6690ff4b
commit fcf1e9ac03
10 changed files with 10 additions and 10 deletions

View File

@ -259,7 +259,7 @@ export class ActionItemEditComponent implements OnInit {
}
save(): void {
if (this.formGroup.invalid || this.waitForResponse) {
if (!this.formGroup.dirty || this.formGroup.invalid || this.waitForResponse) {
return;
}

View File

@ -50,7 +50,7 @@ export class ConnectionItemEditComponent {
}
submit(): void {
if (this.form.invalid || this.waitForResponse) {
if (!this.form.dirty || this.form.invalid || this.waitForResponse) {
return;
}

View File

@ -50,7 +50,7 @@ export class GroupItemEditComponent implements OnInit {
}
add() {
if (this.formGroup.invalid || this.waitForResponse)
if (!this.formGroup.dirty || this.formGroup.invalid || this.waitForResponse)
return;
this.waitForResponse = true;

View File

@ -45,7 +45,7 @@ export class KeyItemEditComponent {
}
submit(): void {
if (this.form.invalid || this.waitForResponse) {
if (!this.form.dirty || this.form.invalid || this.waitForResponse) {
return;
}

View File

@ -58,7 +58,7 @@ export class PermissionItemEditComponent implements OnInit {
}
submit() {
if (this.form.invalid || this.waitForResponse) {
if (!this.form.dirty || this.form.invalid || this.waitForResponse) {
return;
}

View File

@ -60,7 +60,7 @@
</button>
<button mat-button
class="confirm"
[disabled]="formGroup.invalid || waitForResponse"
[disabled]="!formGroup.dirty || formGroup.invalid || waitForResponse"
(click)="save()">
<mat-icon>{{(isNew ? 'add' : 'save')}}</mat-icon>{{(isNew ? 'Add' : 'Save')}}
</button>

View File

@ -79,7 +79,7 @@ export class PolicyItemEditComponent implements OnInit, AfterViewInit {
}
save() {
if (this.formGroup.invalid || this.waitForResponse)
if (!this.formGroup.dirty || this.formGroup.invalid || this.waitForResponse)
return;
this.waitForResponse = true;

View File

@ -102,7 +102,7 @@ export class RedemptionItemEditComponent implements OnInit {
}
save() {
if (this.formGroups.invalid || this.waitForResponse)
if (!this.formGroups.dirty || this.formGroups.invalid || this.waitForResponse)
return;
this.waitForResponse = true;

View File

@ -71,7 +71,7 @@ export class FilterItemEditComponent {
}
onSaveClick(): void {
if (this.forms.invalid || this.waitForResponse)
if (!this.forms.dirty || this.forms.invalid || this.waitForResponse)
return;
this.waitForResponse = true;

View File

@ -41,7 +41,7 @@ export class TwitchUserItemAddComponent implements OnInit {
}
submit() {
if (this.usernameControl.invalid || this.waitForResponse || !this.client.api_key) {
if (!this.usernameControl.dirty || this.usernameControl.invalid || this.waitForResponse || !this.client.api_key) {
return;
}