Add loading state guards to checkPunishment and onSubmit buttons to prevent duplicate actions and update visibility of related variables.
This commit is contained in:
parent
beb5cd496a
commit
a9e9f1f03a
|
|
@ -52,7 +52,8 @@
|
||||||
<input matInput placeholder="Discord ID" [(ngModel)]="discordId"
|
<input matInput placeholder="Discord ID" [(ngModel)]="discordId"
|
||||||
minlength="17" maxlength="18" pattern="^[0-9]+$">
|
minlength="17" maxlength="18" pattern="^[0-9]+$">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<button mat-raised-button (click)="checkPunishment()" [disabled]="authService.username() == null">
|
<button mat-raised-button (click)="checkPunishment()"
|
||||||
|
[disabled]="punishmentLoading || authService.username() == null">
|
||||||
Check punishments
|
Check punishments
|
||||||
</button>
|
</button>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -148,7 +149,7 @@
|
||||||
}
|
}
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<button mat-raised-button (click)="onSubmit()" [disabled]="form.invalid">
|
<button mat-raised-button (click)="onSubmit()" [disabled]="formSubmitting || form.invalid">
|
||||||
Submit Appeal
|
Submit Appeal
|
||||||
</button>
|
</button>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ export class DiscordAppealComponent implements OnInit {
|
||||||
return this.currentPageIndex === this.totalPages.length - 1;
|
return this.currentPageIndex === this.totalPages.length - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private punishmentLoading: boolean = false;
|
protected punishmentLoading: boolean = false;
|
||||||
|
|
||||||
protected checkPunishment() {
|
protected checkPunishment() {
|
||||||
if (this.punishmentLoading) {
|
if (this.punishmentLoading) {
|
||||||
|
|
@ -180,7 +180,7 @@ export class DiscordAppealComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private formSubmitting: boolean = false;
|
protected formSubmitting: boolean = false;
|
||||||
|
|
||||||
private sendForm() {
|
private sendForm() {
|
||||||
if (this.formSubmitting) {
|
if (this.formSubmitting) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user