mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-21 07:16:18 -04:00
Fix splash screen background color and install title
This commit is contained in:
parent
3ad1a6e0ef
commit
b8b23cd807
3 changed files with 5 additions and 10 deletions
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue