mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -7,14 +8,21 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
export class HttpErrorHandle {
|
||||
|
||||
constructor(
|
||||
private toastService: ToastService
|
||||
private toastService: ToastService,
|
||||
private backgroundService: BackgroundService
|
||||
) { }
|
||||
|
||||
httpStatusHandle(error) {
|
||||
async httpStatusHandle(error) {
|
||||
switch (error.status
|
||||
) {
|
||||
case 0:
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
const result = await this.backgroundService.offline()
|
||||
if(result) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case 400:
|
||||
this.toastService._badRequest('Lamentamos, mas houve um problema com sua solicitação. Por favor, tente novamente')
|
||||
|
||||
Reference in New Issue
Block a user