Added checks for non-dirty forms when saving/adding.
This commit is contained in:
parent
1e6690ff4b
commit
fcf1e9ac03
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user