From 32e3fbad705f4432f800450428874015bac42172 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 21 Nov 2018 22:12:25 +0000 Subject: [PATCH] webapp work, push required for https --- toys/starship/starship.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toys/starship/starship.js b/toys/starship/starship.js index 56fe35e..82a0497 100644 --- a/toys/starship/starship.js +++ b/toys/starship/starship.js @@ -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"; + } }); }); }