snapdrop

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

commit b8b23cd807c1786692a8111a90d8be5b6dc88b0a
parent 3ad1a6e0efa746715aa767cbfbacf48252079d64
Author: RobinLinus <robinlinus@users.noreply.github.com>
Date:   Thu, 14 Mar 2019 20:20:50 +0100

Fix splash screen background color and install title

Diffstat:
Mclient/index.html | 2+-
Mclient/manifest.json | 2+-
Mclient/scripts/ui.js | 11+++--------
3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/client/index.html b/client/index.html @@ -44,7 +44,7 @@ <use xlink:href="#notifications" /> </svg> </a> - <a href="#" id="install" class="icon-button" title="Add to Homescreen"> + <a href="#" id="install" class="icon-button" title="Install Snapdrop"> <svg class="icon"> <use xlink:href="#homescreen" /> </svg> diff --git a/client/manifest.json b/client/manifest.json @@ -22,7 +22,7 @@ "sizes": "512x512", "type": "image/png" }], - "background_color": "#3367d6", + "background_color": "#efefef", "start_url": "/", "display": "minimal-ui", "theme_color": "#3367d6", diff --git a/client/scripts/ui.js b/client/scripts/ui.js @@ -526,18 +526,13 @@ if ('serviceWorker' in navigator) { // don't display install banner when installed window.addEventListener('beforeinstallprompt', e => { if (window.matchMedia('(display-mode: standalone)').matches) { - return event.preventDefault(); + return e.preventDefault(); } else { const deferredPrompt = e; const btn = document.querySelector('#install') btn.hidden = false; - btn.onclick = _ => { - deferredPrompt.prompt(); - // Wait for the user to respond to the prompt - deferredPrompt.userChoice.then((resp) => { - console.log(JSON.stringify(resp)); - }); - } + btn.onclick = _ => deferredPrompt.prompt(); + return e.preventDefault(); } }); }