diff --git a/public/service-worker.js b/public/service-worker.js index cb99fa4..f309d32 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -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( diff --git a/public/updates/index.html b/public/updates/index.html index 27aa4cb..15743bd 100644 --- a/public/updates/index.html +++ b/public/updates/index.html @@ -51,7 +51,8 @@
MineXLauncher 1.5 -
  • hello there
  • +
  • MineXLauncher now works offline!
  • +
  • You can now install MineXLauncher as a PWA web app

  • MineXLauncher 1.4
  • Added welcome and setup screen
  • diff --git a/src/resources/scripts/main.ts b/src/resources/scripts/main.ts index c2c1042..1a04e41 100644 --- a/src/resources/scripts/main.ts +++ b/src/resources/scripts/main.ts @@ -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); } diff --git a/src/resources/scripts/settings.ts b/src/resources/scripts/settings.ts index a7196cf..a07b356 100644 --- a/src/resources/scripts/settings.ts +++ b/src/resources/scripts/settings.ts @@ -58,8 +58,12 @@ if (window.location.pathname === '/welcome.html') { storage.local.set('theme', themeSelect.value); storage.local.set('lastVersion', launcherVersion); - // @ts-expect-error - installPwaEvent?.prompt(); + try { + // @ts-expect-error + installPwaEvent.prompt(); + } catch (error) { + console.log('Failed to prompt PWA install:', error); + } // @ts-expect-error window.top.location.href = '/';