diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 2043460b5..fe7b6f9f5 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -80,14 +80,11 @@ export class DespachoPage implements OnInit { return; } }); - + this.LoadTaskDetail(this.serialnumber) this.backgroundservice.registerBackService('Online', () => { this.LoadTaskDetail(this.serialnumber) }); - - this.getFromDb() - } close() { @@ -167,16 +164,15 @@ export class DespachoPage implements OnInit { }); }); }, (error) => { - try { - this.goBack() - } catch (e) { - this.location.back(); - } finally { - if (error.status == 0) { - this.toastService.badRequest('Não é possível visualizar este processo no modo offline') - } else { - this.toastService.badRequest('Processo não encontrado') + if (error.status == 0) { + this.getFromDb(); + } else { + try { + this.goBack() + } catch (e) { + this.location.back(); } + this.toastService.badRequest('Processo não encontrado') } }); }