diff --git a/assets/js/app.js b/assets/js/app.js index f9e0a4c..9f5e776 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -2025,12 +2025,14 @@ async function loadSettingsUI() { // Only shown when _kioskBridge JS interface is available (Android WebView). function _injectKioskOverlay() { if (typeof _kioskBridge === 'undefined') return; - if (document.getElementById('_kiosk_overlay')) return; - // Mark header so CSS can center the title + // Always mark header as kiosk-mode (idempotent) — must happen even if buttons + // were already injected by the native onPageFinished Kotlin callback. const appHeader = document.querySelector('.app-header'); if (appHeader) appHeader.classList.add('kiosk-mode'); + if (document.getElementById('_kiosk_overlay')) return; + const headerLeft = document.getElementById('header-left'); if (!headerLeft) return; @@ -6869,7 +6871,7 @@ function selectUseLocation(btn, loc) { // After 3+ consistent choices from the same location for a product, // auto-selects it and hides the location picker (user can still tap "cambia"). const _PREF_LOC_KEY = '_prefUseLoc'; -const _PREF_LOC_NEEDED = 3; // choices needed to confirm a preference +const _PREF_LOC_NEEDED = 2; // choices needed to confirm a preference function _getPrefLocHistory(productId) { try { diff --git a/evershelf-kiosk/app/src/main/kotlin/it/dadaloop/evershelf/kiosk/KioskActivity.kt b/evershelf-kiosk/app/src/main/kotlin/it/dadaloop/evershelf/kiosk/KioskActivity.kt index 2cfa74b..52cee20 100644 --- a/evershelf-kiosk/app/src/main/kotlin/it/dadaloop/evershelf/kiosk/KioskActivity.kt +++ b/evershelf-kiosk/app/src/main/kotlin/it/dadaloop/evershelf/kiosk/KioskActivity.kt @@ -538,10 +538,11 @@ class KioskActivity : AppCompatActivity() { private fun showNativeUpdateBanner(message: String, apkDownloadUrl: String) { pendingApkDownloadUrl = apkDownloadUrl tvUpdateMessage.text = "⬆️ Aggiornamento disponibile: $message" + // Reset button to initial state so user can confirm before download starts + btnInstallUpdate.isEnabled = true + btnInstallUpdate.text = "⬇ Scarica" updateBanner.visibility = View.VISIBLE - // Auto-start download immediately — no timer hide, stays until done or dismissed - activeInstallBtn = btnInstallUpdate - triggerApkDownload(apkDownloadUrl) + // Download starts only when the user taps btnInstallUpdate } // ── APK Download + Install ─────────────────────────────────────────────