From dc90cbf74b6a643dea5b0658189c5357e962195e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douglas=20Gad=C3=AAlha?= Date: Mon, 23 Sep 2024 21:51:56 -0300 Subject: [PATCH] Ocultar os alertas apenas nos eventos tratados do PWA --- packages/ide/src/app/pwa.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/ide/src/app/pwa.service.ts b/packages/ide/src/app/pwa.service.ts index b4bc5420..40ab2ca3 100644 --- a/packages/ide/src/app/pwa.service.ts +++ b/packages/ide/src/app/pwa.service.ts @@ -20,11 +20,11 @@ export class PwaService { this.swUpdate.versionUpdates.subscribe(event => { console.log("PWA:", event); - this.loadingToast?.close(); - this.versionReadyToast?.close(); - switch (event.type) { case "VERSION_DETECTED": { + this.loadingToast?.close(); + this.versionReadyToast?.close(); + this.loadingToast = this.toast.loading("Baixando atualizações…", { autoClose: true, duration: 5000, @@ -34,6 +34,9 @@ export class PwaService { } case "VERSION_READY": { + this.loadingToast?.close(); + this.versionReadyToast?.close(); + this.versionReadyToast = this.toast.success(NewVersionAvailableComponent, { autoClose: false, dismissible: true,