snapdrop

A Progressive Web App for local file sharing
git clone http://git.hanabi.in/repos/snapdrop.git
Log | Files | Refs | README | LICENSE

commit aa9e9497d6ba290e3d0680dcbc1a462336cd33c0
parent d8dcbfcb0f8f2acb0716d7bc5b54088e4c688b34
Author: RobinLinus <robin_woll@capira.de>
Date:   Mon, 30 May 2016 02:09:54 -0600

Merge pull request #23 from remy/master

fix: don't display install banner when installed
Diffstat:
Mapp/scripts/app.js | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/app/scripts/app.js b/app/scripts/app.js @@ -14,6 +14,14 @@ // app.baseUrl = '/polymer-starter-kit/'; } + // don't display the install prompt if the user has *already* installed + window.addEventListener('beforeinstallprompt', function(event) { + if (window.matchMedia('(display-mode: standalone)').matches) { + return event.preventDefault(); + } + }); + + app.displayInstalledToast = function() { // Check to make sure caching is actually enabled—it won't be in the dev environment. if (!Polymer.dom(document).querySelector('platinum-sw-cache').disabled) {