mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
Cleanup
This commit is contained in:
parent
027d093472
commit
c8ec00b345
1 changed files with 17 additions and 19 deletions
|
@ -516,26 +516,24 @@ document.copy = text => {
|
|||
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker
|
||||
.register('/service-worker.js')
|
||||
navigator.serviceWorker.register('/service-worker.js')
|
||||
.then(serviceWorker => {
|
||||
console.log('Service Worker registered');
|
||||
window.serviceWorker = serviceWorker
|
||||
});
|
||||
}
|
||||
|
||||
// don't display install banner when installed
|
||||
window.addEventListener('beforeinstallprompt', e => {
|
||||
if (window.matchMedia('(display-mode: standalone)').matches) {
|
||||
// don't display install banner when installed
|
||||
return e.preventDefault();
|
||||
} else {
|
||||
const deferredPrompt = e;
|
||||
const btn = document.querySelector('#install')
|
||||
btn.hidden = false;
|
||||
btn.onclick = _ => deferredPrompt.prompt();
|
||||
btn.onclick = _ => e.prompt();
|
||||
return e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Background Animation
|
||||
Events.on('load', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue