onbeforinstallprompt-test

This commit is contained in:
silas 2018-10-08 14:30:17 +02:00
parent 396b651fc5
commit e7977aa487

View File

@ -62,10 +62,12 @@ export class WordRotatorSettingFragment extends LocalStorageSettingsFragment {
});
InstallManager.setCanInstallListener((e) => {
console.log("can install!");
let installButton = this.findBy("#install-button");
installButton.addEventListener("click", () => {
e.prompt();
e["userChoice"].then(res => {
console.log(res);
if (res["outcome"] === 'accepted') {
installButton.classList.add("hidden");
}