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 {
|
save(): void {
|
||||||
if (this.formGroup.invalid || this.waitForResponse) {
|
if (!this.formGroup.dirty || this.formGroup.invalid || this.waitForResponse) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ export class ConnectionItemEditComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submit(): void {
|
submit(): void {
|
||||||
if (this.form.invalid || this.waitForResponse) {
|
if (!this.form.dirty || this.form.invalid || this.waitForResponse) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ export class GroupItemEditComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add() {
|
add() {
|
||||||
if (this.formGroup.invalid || this.waitForResponse)
|
if (!this.formGroup.dirty || this.formGroup.invalid || this.waitForResponse)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.waitForResponse = true;
|
this.waitForResponse = true;
|
||||||
|
@ -45,7 +45,7 @@ export class KeyItemEditComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submit(): void {
|
submit(): void {
|
||||||
if (this.form.invalid || this.waitForResponse) {
|
if (!this.form.dirty || this.form.invalid || this.waitForResponse) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ export class PermissionItemEditComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submit() {
|
submit() {
|
||||||
if (this.form.invalid || this.waitForResponse) {
|
if (!this.form.dirty || this.form.invalid || this.waitForResponse) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button mat-button
|
<button mat-button
|
||||||
class="confirm"
|
class="confirm"
|
||||||
[disabled]="formGroup.invalid || waitForResponse"
|
[disabled]="!formGroup.dirty || formGroup.invalid || waitForResponse"
|
||||||
(click)="save()">
|
(click)="save()">
|
||||||
<mat-icon>{{(isNew ? 'add' : 'save')}}</mat-icon>{{(isNew ? 'Add' : 'Save')}}
|
<mat-icon>{{(isNew ? 'add' : 'save')}}</mat-icon>{{(isNew ? 'Add' : 'Save')}}
|
||||||
</button>
|
</button>
|
||||||
|
@ -79,7 +79,7 @@ export class PolicyItemEditComponent implements OnInit, AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
if (this.formGroup.invalid || this.waitForResponse)
|
if (!this.formGroup.dirty || this.formGroup.invalid || this.waitForResponse)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.waitForResponse = true;
|
this.waitForResponse = true;
|
||||||
|
@ -102,7 +102,7 @@ export class RedemptionItemEditComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
if (this.formGroups.invalid || this.waitForResponse)
|
if (!this.formGroups.dirty || this.formGroups.invalid || this.waitForResponse)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.waitForResponse = true;
|
this.waitForResponse = true;
|
||||||
|
@ -71,7 +71,7 @@ export class FilterItemEditComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onSaveClick(): void {
|
onSaveClick(): void {
|
||||||
if (this.forms.invalid || this.waitForResponse)
|
if (!this.forms.dirty || this.forms.invalid || this.waitForResponse)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.waitForResponse = true;
|
this.waitForResponse = true;
|
||||||
|
@ -41,7 +41,7 @@ export class TwitchUserItemAddComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submit() {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user