webapp work, push required for https
This commit is contained in:
parent
af8375e36c
commit
32e3fbad70
|
@ -55,19 +55,22 @@ function init() {
|
|||
}
|
||||
|
||||
// Let people add this app
|
||||
let deferredPrompt;
|
||||
let installButton = document.querySelector("#install");
|
||||
installButton.style.display = "none";
|
||||
window.addEventListener("beforeinstallprompt", e => {
|
||||
console.log(e);
|
||||
deferredPrompt = e;
|
||||
installButton.style.display = "block";
|
||||
});
|
||||
installButton.addEventListener("click", e => {
|
||||
console.log(e);
|
||||
deferredPrompt.prompt();
|
||||
deferredPrompt.userChoice
|
||||
.then(result => {
|
||||
if (result.output == "accepted") {
|
||||
installButton.style.display = "none"
|
||||
};
|
||||
installButton.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue