Skip to content

Commit

Permalink
Ocultar os alertas apenas nos eventos tratados do PWA
Browse files Browse the repository at this point in the history
  • Loading branch information
dgadelha committed Sep 24, 2024
1 parent 9fa483d commit dc90cbf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/ide/src/app/pwa.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit dc90cbf

Please sign in to comment.