fix: kiosk title center + location pref 2 uses + update confirm before download

app.js:
- _injectKioskOverlay: move kiosk-mode class assignment BEFORE the
  _kiosk_overlay existence guard — fixes race where Kotlin onPageFinished
  injects buttons during the await api() pause, then JS skips the class
- _PREF_LOC_NEEDED: 3 → 2 (remember use-location after 2 picks, not 3)

KioskActivity.kt:
- showNativeUpdateBanner: remove auto-start of triggerApkDownload;
  banner now shows with 'Scarica' button enabled, download only starts
  when user taps it (confirms before install)
This commit is contained in:
dadaloop82
2026-05-06 11:24:29 +00:00
parent 6d098a80a6
commit f04e227cc0
2 changed files with 9 additions and 6 deletions
@@ -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 ─────────────────────────────────────────────