From 7d89ed8bd2078222503f586a68cdf47ef3b79ce4 Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 8 May 2026 10:15:31 +0200 Subject: [PATCH] Fix: Schnell-Gassi zeigt korrekte Meldung wenn offline gequeuet statt falsches Erfolgs-Toast (SW by-v764) --- backend/main.py | 2 +- backend/static/index.html | 2 +- backend/static/js/app.js | 2 +- backend/static/js/worlds.js | 8 ++++++-- backend/static/sw.js | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/backend/main.py b/backend/main.py index 1934bc3..32cd7e6 100644 --- a/backend/main.py +++ b/backend/main.py @@ -327,7 +327,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media") os.makedirs(MEDIA_DIR, exist_ok=True) app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media") -APP_VER = "763" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "764" # muss mit APP_VER in app.js übereinstimmen @app.get("/api/version") async def app_version(): diff --git a/backend/static/index.html b/backend/static/index.html index 97e866f..cfe32d2 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -578,7 +578,7 @@ - + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 8162f75..5666b13 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '763'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '764'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.5.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; diff --git a/backend/static/js/worlds.js b/backend/static/js/worlds.js index 438dd1f..3ad273f 100644 --- a/backend/static/js/worlds.js +++ b/backend/static/js/worlds.js @@ -513,9 +513,13 @@ window.Worlds = (() => { if (weatherData) { payload.weather_json = JSON.stringify(weatherData); } - await API.post(`/dogs/${dog.id}/diary`, payload); + const result = await API.post(`/dogs/${dog.id}/diary`, payload); _close(); - UI.toast?.success(`Gassi eingetragen! ${selectedMin} min 🐾`); + if (result?._queued) { + UI.toast?.info(`Gassi gespeichert — wird synchronisiert wenn online 🐾`); + } else { + UI.toast?.success(`Gassi eingetragen! ${selectedMin} min 🐾`); + } // Streak-Cache invalidieren try { localStorage.removeItem('w3_streak_' + dog.id); } catch {} // JETZT-Welt neu rendern für aktuellen Streak diff --git a/backend/static/sw.js b/backend/static/sw.js index c5f525d..74e9882 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v763'; +const CACHE_VERSION = 'by-v764'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache