Fix: Foto-Upload im Hunde-Profil Edit-Modal (SW by-v933)

Root cause: fotoFile-Referenz wurde NACH UI.modal.close() geholt — DOM-Element
#dp-form-foto existiert nach Modal-Close nicht mehr → files[0] = undefined → Upload übersprungen.
Fix: fotoFile VOR modal.close() sichern; File-Objekt bleibt gültig auch ohne DOM.
This commit is contained in:
rene 2026-05-14 12:03:25 +02:00
parent 781e3383bd
commit 08f1806be3
4 changed files with 6 additions and 4 deletions

View file

@ -406,7 +406,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 = "932" # muss mit APP_VER in app.js übereinstimmen APP_VER = "933" # 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():

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung. Router, State-Management, Navigation, Initialisierung.
============================================================ */ ============================================================ */
const APP_VER = '932'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VER = '933'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VERSION = '1.5.1'; // ← semantische Version, wird bei make release gesetzt const APP_VERSION = '1.5.1'; // ← 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

View file

@ -1354,6 +1354,9 @@ window.Page_dog_profile = (() => {
fell_typ: fd.fell_typ || null, fell_typ: fd.fell_typ || null,
}; };
// Datei-Referenz VOR Modal-Close sichern — DOM-Element wird beim Schließen entfernt
const fotoFile = document.getElementById('dp-form-foto')?.files[0];
let saved; let saved;
if (dog) { if (dog) {
saved = await API.dogs.update(dog.id, payload); saved = await API.dogs.update(dog.id, payload);
@ -1371,7 +1374,6 @@ window.Page_dog_profile = (() => {
} }
// Foto hochladen wenn gewählt // Foto hochladen wenn gewählt
const fotoFile = document.getElementById('dp-form-foto')?.files[0];
if (fotoFile) { if (fotoFile) {
try { try {
const fd = new FormData(); const fd = new FormData();

View file

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