Napster2210 / ngx-spinner

A library for loading spinner for Angular 4 - 17.
https://napster2210.github.io/ngx-spinner/
MIT License
823 stars 140 forks source link

Hide Function Doesn't work In Mobile Browser #221

Open Daniel921 opened 2 years ago

Daniel921 commented 2 years ago

spinner.hide() tests work on PC, but it doesn't work on mobile browser

Angular Version:13.2.4 ngx-spinner Version: 13.1.1

intercept(req: HttpRequest<any>, next: HttpHandler) {
    this.spinner.show();
    return next.handle(req).pipe(
      tap((event: HttpEvent<any>) => {
        if (event instanceof HttpResponse && event.status >= 200 && event.status < 300 && req.url.includes('seat')) {
          this.spinner.hide();   // doesn't work
        }
      })
    );
  }