rgab1508 / PixelCraft

A Pixel Art Editor
https://rgab1508.github.io/PixelCraft
MIT License
1.27k stars 78 forks source link

fix: show install pwa btn only when it's installable #58

Closed kt3k closed 2 years ago

kt3k commented 2 years ago

We set global msg variable at beforeinstallprompt event. However beforeinstallprompt isn't fired if the user already installed the app, and in that case, clicking install btn causes msg.prompt() call with nulled msg. I think that caused #53

This PR fixes the above situation. With this change we show the Install PWA button only when the app is ready to install, and hide it otherwise.

closes #53

theabbie commented 2 years ago

@kt3k Great addition, thanks