1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-08 09:24:48 +00:00
This commit is contained in:
zumbiepig 2024-08-19 08:22:45 -07:00
parent 365d5014d1
commit 978bb9a224
4 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,5 @@
const cacheVersion = 'v1.5';
const cacheName = `minexlauncher-${cacheVersion}`;
const cacheVersion = '1.5';
const cacheName = `minexlauncher-v${cacheVersion}`;
self.addEventListener('install', (event) => {
event.waitUntil(

View File

@ -51,7 +51,8 @@
<div class="news-item">
<!-- Don't forget to update launcherVersion and the changelog in main.js as well -->
<strong>MineXLauncher 1.5</strong>
<li>hello there</li>
<li>MineXLauncher now works offline!</li>
<li>You can now install MineXLauncher as a PWA web app</li>
<br />
<strong>MineXLauncher 1.4</strong>
<li>Added welcome and setup screen</li>

View File

@ -287,6 +287,7 @@ if (window.location.pathname === '/') {
alert(`MineXLauncher has been updated to v${launcherVersion}!
Changes in v${launcherVersion}:
- MineXLauncher now works offline!
- You can now install MineXLauncher as a PWA web app`);
storage.local.set('lastVersion', launcherVersion);
}

View File

@ -58,8 +58,12 @@ if (window.location.pathname === '/welcome.html') {
storage.local.set('theme', themeSelect.value);
storage.local.set('lastVersion', launcherVersion);
try {
// @ts-expect-error
installPwaEvent?.prompt();
installPwaEvent.prompt();
} catch (error) {
console.log('Failed to prompt PWA install:', error);
}
// @ts-expect-error
window.top.location.href = '/';