Fixed waiting for responses in code for certain actions.
This commit is contained in:
parent
d0556dce9c
commit
2f2215b041
@ -52,6 +52,7 @@ export class GroupItemEditComponent implements OnInit {
|
||||
if (this.formGroup.invalid || this.waitForResponse)
|
||||
return;
|
||||
|
||||
this.waitForResponse = true;
|
||||
this._client.first((d: any) => d.op == 4 && d.d.request.type == 'create_group' && d.d.data.name == this.nameForm.value)
|
||||
.subscribe({
|
||||
next: (d) => this._dialogRef.close(d.d.data),
|
||||
|
@ -81,8 +81,11 @@ export class RedemptionItemEditComponent implements OnInit {
|
||||
|
||||
|
||||
delete() {
|
||||
const id = this.redemption.id;
|
||||
if (this.waitForResponse)
|
||||
return;
|
||||
|
||||
this.waitForResponse = true
|
||||
const id = this.redemption.id;
|
||||
this.client.first((d: any) => d.op == 4 && d.d.request.type == 'delete_redemption' && d.d.request.data.id == id)
|
||||
?.subscribe({
|
||||
next: (d) => {
|
||||
@ -100,13 +103,15 @@ export class RedemptionItemEditComponent implements OnInit {
|
||||
}
|
||||
|
||||
save() {
|
||||
if (this.formGroups.invalid)
|
||||
if (this.formGroups.invalid || this.waitForResponse)
|
||||
return;
|
||||
|
||||
this.waitForResponse = true;
|
||||
this.responseError = undefined;
|
||||
const order = this.orderFormControl.value;
|
||||
if (order == null) {
|
||||
this.responseError = 'Order must be an integer.';
|
||||
this.waitForResponse = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ export class FilterItemEditComponent {
|
||||
}
|
||||
|
||||
onSaveClick(): void {
|
||||
if (this.forms.invalid)
|
||||
if (this.forms.invalid || this.waitForResponse)
|
||||
return;
|
||||
|
||||
this.waitForResponse = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user