Feature: Einmaliger Offline-Hinweis 'App im Vordergrund lassen'
Beim ersten offline-Event pro Session erscheint ein blauer Info-Toast (8s): 'App im Vordergrund lassen — so bleiben Offline-Funktionen wie GPS und Datenspeicherung aktiv.' sessionStorage-Guard verhindert Wiederholung. SW by-v997, APP_VER 997
This commit is contained in:
parent
1d67d6307e
commit
902e6b8602
5 changed files with 14 additions and 3 deletions
|
|
@ -410,7 +410,7 @@ async def serve_media(path: str, request: _Request):
|
||||||
raise _HE(404, "Nicht gefunden.")
|
raise _HE(404, "Nicht gefunden.")
|
||||||
return _media_response(filepath)
|
return _media_response(filepath)
|
||||||
|
|
||||||
APP_VER = "996" # muss mit APP_VER in app.js übereinstimmen
|
APP_VER = "997" # muss mit APP_VER in app.js übereinstimmen
|
||||||
|
|
||||||
@app.get("/.well-known/assetlinks.json")
|
@app.get("/.well-known/assetlinks.json")
|
||||||
async def assetlinks():
|
async def assetlinks():
|
||||||
|
|
|
||||||
|
|
@ -625,6 +625,16 @@
|
||||||
}
|
}
|
||||||
window.addEventListener('offline', function() {
|
window.addEventListener('offline', function() {
|
||||||
_updateBanner();
|
_updateBanner();
|
||||||
|
// Einmaliger Hinweis pro Session: App im Vordergrund lassen
|
||||||
|
if (!sessionStorage.getItem('by_offline_hint_shown')) {
|
||||||
|
sessionStorage.setItem('by_offline_hint_shown', '1');
|
||||||
|
setTimeout(function() {
|
||||||
|
window.UI?.toast?.info(
|
||||||
|
'App im Vordergrund lassen — so bleiben Offline-Funktionen wie GPS und Datenspeicherung aktiv.',
|
||||||
|
8000
|
||||||
|
);
|
||||||
|
}, 800);
|
||||||
|
}
|
||||||
// Queue-Count abfragen
|
// Queue-Count abfragen
|
||||||
if (navigator.serviceWorker) {
|
if (navigator.serviceWorker) {
|
||||||
navigator.serviceWorker.ready.then(function(reg) {
|
navigator.serviceWorker.ready.then(function(reg) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Router, State-Management, Navigation, Initialisierung.
|
Router, State-Management, Navigation, Initialisierung.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const APP_VER = '996'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
const APP_VER = '997'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||||
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
|
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
|
||||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||||
|
|
|
||||||
|
|
@ -780,6 +780,7 @@ window.Page_routes = (() => {
|
||||||
setTimeout(() => banner.remove(), 9000);
|
setTimeout(() => banner.remove(), 9000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const ctrl = document.getElementById('rk-rec-ctrl');
|
const ctrl = document.getElementById('rk-rec-ctrl');
|
||||||
ctrl.innerHTML = `
|
ctrl.innerHTML = `
|
||||||
<button id="rk-rec-stopbtn" style="${_btnStyle()}flex:1;border-color:var(--c-danger);background:var(--c-danger);color:#fff;position:relative;overflow:hidden;touch-action:none;user-select:none;">
|
<button id="rk-rec-stopbtn" style="${_btnStyle()}flex:1;border-color:var(--c-danger);background:var(--c-danger);color:#fff;position:relative;overflow:hidden;touch-action:none;user-select:none;">
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Offline-Cache + Push Notifications + Tile-Cache
|
Offline-Cache + Push Notifications + Tile-Cache
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const CACHE_VERSION = 'by-v996';
|
const CACHE_VERSION = 'by-v997';
|
||||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue