I have a function that runs on button click. Let’s call it reserve()
.
In this scenario a user clicks reserve, a please wait loading animation comes up then it goes to the next page. This works perfectly fine.
Now theres the case when a user is not logged in and they want to reserve
, it then kicks them to the login page, after login it goes back to the URL where they can click the reserve button. This is where the problem comes in as the loading animation simply does not display when the user clicks reserve.
the code is not that complicated:
async reserveUnit() {
this.reserving = true;
await this.loaderSpinnerService.showSpinner(
this.translate.instant('PLEASE_WAIT')
);
this.reserveUnitService().reserveUnit();
}