diff --git a/public/pwaInstall.js b/public/pwaInstall.js index 4c78f78..0f13298 100644 --- a/public/pwaInstall.js +++ b/public/pwaInstall.js @@ -1,24 +1,20 @@ // src/pwaInstall.js let deferredPrompt = null; -// Stocke l'événement natif quand Chrome le déclenche window.addEventListener('beforeinstallprompt', (e) => { e.preventDefault(); deferredPrompt = e; - console.log('PWA: Install prompt ready - button can trigger it'); + console.log('PWA prompt ready'); }); -// Fonction appelée par le bouton "Install" export function promptInstall() { if (deferredPrompt) { - console.log('PWA: Triggering native install prompt'); deferredPrompt.prompt(); deferredPrompt.userChoice.then((choice) => { - console.log('PWA Install outcome:', choice.outcome); - deferredPrompt = null; + console.log('Install outcome:', choice.outcome); }); + deferredPrompt = null; } else { - console.log('PWA: No prompt ready yet - scroll/click more'); - alert('PWA not ready yet. Try scrolling the map, clicking filters or markers, then click Install again.'); + alert('Prompt not ready. Scroll the map, click a filter, then try again.'); } } \ No newline at end of file