Fix: kein zweiter SW-Reload nach force-update (by_skip_sw_reload Flag), Tagebuch bleibt offen (SW by-v819)

This commit is contained in:
rene 2026-05-10 09:04:12 +02:00
parent 9139e33492
commit 25417364d2
4 changed files with 17 additions and 10 deletions

View file

@ -341,7 +341,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 = "818" # muss mit APP_VER in app.js übereinstimmen
APP_VER = "819" # muss mit APP_VER in app.js übereinstimmen
@app.get("/.well-known/assetlinks.json")
async def assetlinks():
@ -1624,6 +1624,8 @@ p{color:#94a3b8;font-size:14px}</style></head>
<div> Aktualisiere Ban Yaro</div>
<p id="s">Service Worker wird entfernt</p>
<script>
// Zweiten Reload durch SW-updatefound verhindern
sessionStorage.setItem('by_skip_sw_reload','1');
// Fire-and-forget kein await, Reload nach spätestens 1.5s
try{
navigator.serviceWorker?.getRegistrations().then(r=>r.forEach(s=>s.unregister())).catch(()=>{});