From 4a6c056742e0f9a938c2d45518c5ece71277758b Mon Sep 17 00:00:00 2001 From: rene Date: Fri, 8 May 2026 11:17:38 +0200 Subject: [PATCH] Feature: Schnell-Gassi pingt nur noch Streak, kein Tagebucheintrag mehr (SW by-v768) --- backend/main.py | 2 +- backend/static/index.html | 2 +- backend/static/js/app.js | 2 +- backend/static/js/worlds.js | 17 +++-------------- backend/static/sw.js | 2 +- 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/backend/main.py b/backend/main.py index 974b3f9..4354f38 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 = "767" # muss mit APP_VER in app.js übereinstimmen +APP_VER = "768" # 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 fbe19b2..087f843 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 788927f..3ce454e 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 = '767'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '768'; // ← 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 3ad273f..a3d0162 100644 --- a/backend/static/js/worlds.js +++ b/backend/static/js/worlds.js @@ -505,21 +505,10 @@ window.Worlds = (() => { submitBtn.textContent = 'Wird eingetragen…'; try { - const payload = { - typ: 'gassi', - titel: 'Schnell-Gassi 🐾', - text: `Kurze Runde, ${selectedMin} Minuten`, - }; - if (weatherData) { - payload.weather_json = JSON.stringify(weatherData); - } - const result = await API.post(`/dogs/${dog.id}/diary`, payload); + // Kein Tagebucheintrag — nur Streak pingen + await API.post(`/streak/${dog.id}/ping`); _close(); - if (result?._queued) { - UI.toast?.info(`Gassi gespeichert — wird synchronisiert wenn online 🐾`); - } else { - UI.toast?.success(`Gassi eingetragen! ${selectedMin} min 🐾`); - } + 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 c3e4362..5d28c8a 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-v767'; +const CACHE_VERSION = 'by-v768'; 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