From a43535cf867064f7f27c57217d5e9cb5b436353a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Tue, 19 Oct 2021 10:51:13 +0100 Subject: [PATCH] bug fixed on despacho page about presenting despacho by serialnumber --- .../despachos/despacho/despacho.page.ts | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) 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') } }); }