onbeforinstallprompt-test
This commit is contained in:
parent
396b651fc5
commit
e7977aa487
@ -62,10 +62,12 @@ export class WordRotatorSettingFragment extends LocalStorageSettingsFragment {
|
|||||||
});
|
});
|
||||||
|
|
||||||
InstallManager.setCanInstallListener((e) => {
|
InstallManager.setCanInstallListener((e) => {
|
||||||
|
console.log("can install!");
|
||||||
let installButton = this.findBy("#install-button");
|
let installButton = this.findBy("#install-button");
|
||||||
installButton.addEventListener("click", () => {
|
installButton.addEventListener("click", () => {
|
||||||
e.prompt();
|
e.prompt();
|
||||||
e["userChoice"].then(res => {
|
e["userChoice"].then(res => {
|
||||||
|
console.log(res);
|
||||||
if (res["outcome"] === 'accepted') {
|
if (res["outcome"] === 'accepted') {
|
||||||
installButton.classList.add("hidden");
|
installButton.classList.add("hidden");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user