Fix: Altes Hundeprofil-Foto wird beim Überschreiben gelöscht (SW by-v930)
- dogs.py /photo: alte foto_url vor Upload merken, nach Speichern von Disk löschen - dog-profile.js: Hintergrund-Cache nach Foto-Wechsel invalidieren
This commit is contained in:
parent
3585958c47
commit
567478a866
5 changed files with 19 additions and 5 deletions
|
|
@ -1380,6 +1380,10 @@ window.Page_dog_profile = (() => {
|
|||
saved.foto_url = result.foto_url;
|
||||
_appState.activeDog = { ...saved };
|
||||
_appState.dogs = _appState.dogs.map(d => d.id === saved.id ? _appState.activeDog : d);
|
||||
// Hintergrund-Cache invalidieren damit Welten das neue Foto zeigen
|
||||
const userId = _appState.user?.id || 'anon';
|
||||
const todayKey = `w3_bg3_${userId}_` + new Date().toISOString().slice(0, 10);
|
||||
localStorage.removeItem(todayKey);
|
||||
} catch {
|
||||
UI.toast.warning('Profil gespeichert, Foto konnte nicht hochgeladen werden.');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue