Pages/shows: disable add new show button while loading

This commit is contained in:
Toast 2025-02-03 18:12:22 +01:00
parent 193944d55b
commit 42aa436e81
2 changed files with 3 additions and 1 deletions

View file

@ -12,7 +12,7 @@
</div>
<div class="row justify-content-end mt-3">
<div class="col-2">
<button type="button" class="btn btn-primary" (click)="createNewShow()">Add new show</button>
<button type="button" class="btn btn-primary" (click)="createNewShow()" [disabled]="loading">Add new show</button>
</div>
</div>
</div>

View file

@ -23,6 +23,7 @@ export class ShowsComponent {
private modalService: NgbModal = inject(NgbModal);
shows: Show[] = [];
loading: boolean = true;
constructor() {
let loadToast: Toast = {body: "Loading shows..."};
@ -38,6 +39,7 @@ export class ShowsComponent {
htmlClass: "bg-success text-light"
}
this.toastService.show(successToast);
this.loading = false
}
})
}