mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
improve offline
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user