Skip to content

Commit c6c6404

Browse files
committed
Change download to install.
Triggers PWA install.
1 parent 7e36fae commit c6c6404

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

FF1Blazorizer/Shared/NavMenu.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
<span class="oi oi-random" aria-hidden="true"></span> Randomize
99
</NavLink>
1010
<NavLink class="ffr-nav" href="WhatsNew">
11-
<span class="oi oi-question-mark" aria-hidden="true"></span> Help!
11+
<span class="oi oi-puzzle-piece" aria-hidden="true"></span> Help
1212
</NavLink>
13-
<NavLink class="ffr-nav" href="https://github.com/FiendsOfTheElements/FF1Randomizer/releases">
14-
<span class="oi oi-data-transfer-download" aria-hidden="true"></span> Download
13+
<NavLink class="ffr-nav" href="javascript:showPWAInstall()">
14+
<span class="oi oi-hard-drive" aria-hidden="true"></span> Install
1515
</NavLink>
1616
<NavLink class="ffr-nav" href="https://github.com/FiendsOfTheElements/FF1Randomizer/issues">
17-
<span class="oi oi-bug" aria-hidden="true"></span> Report a Bug
17+
<span class="oi oi-bug" aria-hidden="true"></span> Issues
1818
</NavLink>
1919
<NavLink class="ffr-nav" href="About">
2020
<span class="oi oi-book" aria-hidden="true"></span> About

FF1Blazorizer/wwwroot/js/site.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,14 @@ function updateServiceWorkerNow() {
118118
window.location.reload();
119119
}
120120
}
121+
122+
let pwa;
123+
window.addEventListener('beforeinstallprompt', (e) => {
124+
e.preventDefault();
125+
pwa = e;
126+
});
127+
128+
function showPWAInstall() {
129+
pwa?.prompt();
130+
pwa = null;
131+
}

0 commit comments

Comments
 (0)