Fix: worlds.js doppeltes const dog → SyntaxError behoben, SW by-v640

This commit is contained in:
rene 2026-05-03 10:22:13 +02:00
parent fc2002847c
commit c266814aa9
4 changed files with 8 additions and 9 deletions

View file

@ -566,7 +566,7 @@
<script src="/js/api.js?v=94"></script>
<script src="/js/ui.js?v=94"></script>
<script src="/js/app.js?v=94"></script>
<script src="/js/worlds.js?v=639"></script>
<script src="/js/worlds.js?v=640"></script>
<!-- Feature-Seiten werden lazy geladen -->

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '639'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '640'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VERSION = '1.2.1'; // ← semantische Version, wird bei make release gesetzt
const IS_STAGING = location.hostname === 'staging.banyaro.app';

View file

@ -761,7 +761,11 @@ window.Worlds = (() => {
return;
}
const dog = dogs[0];
// Hunde global cachen für schnelles Cycling
_dogs = dogs;
if (_dogIdx >= _dogs.length) _dogIdx = 0;
const dog = _dogs[_dogIdx];
const [streakRes, diaryRes] = await Promise.allSettled([
_cachedGet(`streak_${dog.id}`, `/streak/${dog.id}`),
_cachedGet(`diary_${dog.id}`, `/dogs/${dog.id}/diary?limit=1`),
@ -770,11 +774,6 @@ window.Worlds = (() => {
const diaryData = diaryRes.value?.data ?? diaryRes.value;
const lastEntry = diaryData?.entries?.[0] || diaryData?.[0] || null;
// Hunde global cachen für schnelles Cycling
_dogs = dogs;
if (_dogIdx >= _dogs.length) _dogIdx = 0;
const dog = _dogs[_dogIdx];
const ageStr = dog.alter_jahre ? _fmtAlter(dog.alter_jahre) : '';
const stats = [dog.rasse, ageStr, dog.gewicht_kg ? dog.gewicht_kg + ' kg' : null].filter(Boolean).join(' · ');
const otherDogs = _dogs.filter((_, i) => i !== _dogIdx);

View file

@ -3,7 +3,7 @@
Offline-Cache + Push Notifications + Tile-Cache
============================================================ */
const CACHE_VERSION = 'by-v639';
const CACHE_VERSION = 'by-v640';
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