ionic-team / ionic-pwa-toolkit

Build lightning fast Progressive Web Apps with zero config and best practices built-in. Go from zero to production ready with Ionic and Stencil (Web Components).
MIT License
633 stars 74 forks source link

@Listen('body:ionToastWillDismiss') in app-main should be specific to the toastId #28

Closed jepiqueau closed 6 years ago

jepiqueau commented 6 years ago

Resources: Before submitting an issue, please consult our docs.

Stencil version: (run npm list @stencil/core from a terminal/cmd prompt and paste output below):

@stencil/starter@0.0.1 /Users/queaujeanpierre/Documents/PWAApps/couchdb-app-starter/couchdb-app-client
└── @stencil/core@0.6.16 

@ionic/core": "0.0.4-1"

I'm submitting a ... (check one with "x") [ x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:

if you are using the ToastController in other app webcomponent ie page ,the page will continuously reload. Expected behavior:

the toast inside the web component should present and dismiss without emiting to the Listen of the app-main meaning that the 'body:ionToastWillDismiss' is not enough specific and at the time we create the window.addEventListener('swUpdate'... we should be able to get the corresponding toastId ie swtoastId and modify the listen as follolw: @Listen('body:ionToastWillDismiss') if(toastId === swtoastId { reload() { window.location.reload(); } }

Steps to reproduce:

easy to reproduce clone the ionic -pwa-toolkit in the app-profile add a toastController and create a toast and present it. the app-profile page will continuously reload Related code:

insert any relevant code here

Other information:

manucorporat commented 6 years ago

This issue does not longer applies