motia / quasar-app-extension-onesignal

Adds onesignal push notifications to quasar framework apps.
MIT License
5 stars 5 forks source link

Pwa updating error #10

Open Deployvix opened 3 years ago

Deployvix commented 3 years ago

Using this extension alongside PWA project with register-service-worker.js and using the method updated to reload the page after new release detection, the browser is reloading multiple times and can't find any release.

Pwa Options:

      workboxPluginMode: 'GenerateSW',
      workboxOptions: { skipWaiting: true, clientsClaim: true }, // only for GenerateSW

Code used in register-service-worker.js

  updated (/* registration */) {
    // console.log(registration)
    Notify.create({
      message:
        'Uma nova versão desta aplicação foi detectada. A aplicação será reiniciada para que a atualização tenha efeito.',
      icon: 'update',
      color: 'grey-8',
      textColor: 'white',
      timeout: 5000,
      onDismiss: () => {
        window.location.reload()
      }
    })
  },