From b349fbb3291f7874a8dc120dab5762473619274e Mon Sep 17 00:00:00 2001 From: Eduard Prigoana Date: Fri, 6 Feb 2026 16:32:37 +0000 Subject: [PATCH] remove install prompt --- index.html | 7 ------- js/app.js | 56 ------------------------------------------------------ styles.css | 9 +++------ 3 files changed, 3 insertions(+), 69 deletions(-) diff --git a/index.html b/index.html index b03f375..9379a9c 100644 --- a/index.html +++ b/index.html @@ -3095,13 +3095,6 @@ -
Cache diff --git a/js/app.js b/js/app.js index 29fad6f..1788899 100644 --- a/js/app.js +++ b/js/app.js @@ -1426,31 +1426,6 @@ document.addEventListener('DOMContentLoaded', async () => { }, }); - let deferredPrompt; - window.addEventListener('beforeinstallprompt', (e) => { - e.preventDefault(); - deferredPrompt = e; - - // Show the manual install button in settings - const installSetting = document.getElementById('install-app-setting'); - if (installSetting) installSetting.style.display = 'flex'; - - if (!localStorage.getItem('installPromptDismissed')) { - showInstallPrompt(deferredPrompt); - } - }); - - document.getElementById('manual-install-btn')?.addEventListener('click', async () => { - if (deferredPrompt) { - deferredPrompt.prompt(); - const { outcome } = await deferredPrompt.userChoice; - console.log(`User response to install prompt: ${outcome}`); - deferredPrompt = null; - const installSetting = document.getElementById('install-app-setting'); - if (installSetting) installSetting.style.display = 'none'; - } - }); - document.getElementById('show-shortcuts-btn')?.addEventListener('click', () => { showKeyboardShortcuts(); }); @@ -1538,37 +1513,6 @@ function showUpdateNotification(updateCallback) { }); } -function showInstallPrompt(deferredPrompt) { - if (!deferredPrompt) return; - - const notification = document.createElement('div'); - notification.className = 'install-prompt'; - notification.innerHTML = ` -
- Install Monochrome -

Install this app for a better experience.

-
-
- - -
- `; - document.body.appendChild(notification); - - document.getElementById('install-btn').addEventListener('click', async () => { - notification.remove(); - deferredPrompt.prompt(); - const { outcome } = await deferredPrompt.userChoice; - console.log(`User response to install prompt: ${outcome}`); - deferredPrompt = null; - }); - - document.getElementById('dismiss-install').addEventListener('click', () => { - notification.remove(); - localStorage.setItem('installPromptDismissed', 'true'); - }); -} - function showMissingTracksNotification(missingTracks) { const modal = document.getElementById('missing-tracks-modal'); const listUl = document.getElementById('missing-tracks-list-ul'); diff --git a/styles.css b/styles.css index c0c8bcd..4be47ee 100644 --- a/styles.css +++ b/styles.css @@ -3204,8 +3204,7 @@ input:checked + .slider::before { } .offline-notification, -.update-notification, -.install-prompt { +.update-notification { position: fixed; bottom: 130px; right: 20px; @@ -3227,8 +3226,7 @@ input:checked + .slider::before { color: #f59e0b; } -.update-notification, -.install-prompt { +.update-notification { flex-direction: column; align-items: stretch; } @@ -4475,8 +4473,7 @@ img[src=''] { } .offline-notification, - .update-notification, - .install-prompt { + .update-notification { left: 10px; right: 10px; max-width: none;