improve offline

This commit is contained in:
Peter Maquiran
2023-07-12 11:39:25 +01:00
202 changed files with 2487 additions and 2571 deletions
@@ -2,6 +2,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { finalize, tap } from 'rxjs/operators';
import { BackgroundService } from './background.service';
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
@@ -33,7 +34,10 @@ export class LoggingInterceptorService {
},
// Operation failed; error is an HttpErrorResponse
error: (error) => {
if (error.status === 0 && error.error instanceof ProgressEvent && !req.url.includes('UserAuthentication/Login')) {
if (error.status === 0 && error.error instanceof ProgressEvent &&
!req.url.includes('UserAuthentication/Login') &&
req.url.includes(environment.apiURL)
) {
// A client-side or network error occurred. Handle it accordingly.
this.backgroundservice.offline();
}