Fix: SW-Update nuklear (unregister all), touch-action pan-y für Scroll, /force-update Route, Geburtstags-KI user_id, konto-loeschen Import (SW by-v791)
This commit is contained in:
parent
f73a2bdeab
commit
97a03ce006
12 changed files with 69 additions and 15 deletions
|
|
@ -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 = "786" # muss mit APP_VER in app.js übereinstimmen
|
||||
APP_VER = "791" # muss mit APP_VER in app.js übereinstimmen
|
||||
|
||||
@app.get("/.well-known/assetlinks.json")
|
||||
async def assetlinks():
|
||||
|
|
@ -1546,6 +1546,7 @@ async def presse():
|
|||
|
||||
@app.get("/konto-loeschen")
|
||||
async def konto_loeschen():
|
||||
from fastapi.responses import HTMLResponse
|
||||
html = """<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
|
|
@ -1594,6 +1595,36 @@ async def konto_loeschen():
|
|||
return HTMLResponse(content=html, headers={"Cache-Control": "max-age=3600"})
|
||||
|
||||
|
||||
# /force-update — SW + Cache-Killer für hartnäckige alte Versionen
|
||||
# ------------------------------------------------------------------
|
||||
@app.get("/force-update")
|
||||
async def force_update():
|
||||
from fastapi.responses import HTMLResponse
|
||||
html = """<!DOCTYPE html><html><head><meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Ban Yaro — Update</title>
|
||||
<style>body{font-family:sans-serif;display:flex;align-items:center;justify-content:center;
|
||||
height:100vh;margin:0;background:#0f1623;color:#fff;flex-direction:column;gap:16px}
|
||||
p{color:#94a3b8;font-size:14px}</style></head>
|
||||
<body>
|
||||
<div>⏳ Aktualisiere Ban Yaro…</div>
|
||||
<p id="s">Service Worker wird entfernt…</p>
|
||||
<script>
|
||||
(async()=>{
|
||||
document.getElementById('s').textContent='Caches werden geleert…';
|
||||
try{
|
||||
const regs=await navigator.serviceWorker.getRegistrations();
|
||||
await Promise.all(regs.map(r=>r.unregister()));
|
||||
const keys=await caches.keys();
|
||||
await Promise.all(keys.map(k=>caches.delete(k)));
|
||||
}catch(e){}
|
||||
document.getElementById('s').textContent='Fertig — weiterleiten…';
|
||||
setTimeout(()=>location.replace('/'),800);
|
||||
})();
|
||||
</script></body></html>"""
|
||||
return HTMLResponse(content=html, headers={"Cache-Control": "no-store"})
|
||||
|
||||
|
||||
# /partner — Influencer-Landingpage
|
||||
# ------------------------------------------------------------------
|
||||
@app.get("/partner")
|
||||
|
|
|
|||
|
|
@ -232,6 +232,7 @@ async def ki_geburtstag(req: BirthdayRequest, request: Request,
|
|||
try:
|
||||
answer = await ki_module.complete(
|
||||
system=system, prompt=prompt, max_tokens=600, requires_premium=False,
|
||||
user_id=user["id"],
|
||||
)
|
||||
with db() as conn:
|
||||
conn.execute(
|
||||
|
|
|
|||
|
|
@ -93,9 +93,9 @@
|
|||
</script>
|
||||
|
||||
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
|
||||
<link rel="stylesheet" href="/css/design-system.css?v=709">
|
||||
<link rel="stylesheet" href="/css/layout.css?v=709">
|
||||
<link rel="stylesheet" href="/css/components.css?v=738">
|
||||
<link rel="stylesheet" href="/css/design-system.css?v=788">
|
||||
<link rel="stylesheet" href="/css/layout.css?v=788">
|
||||
<link rel="stylesheet" href="/css/components.css?v=788">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '786'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '791'; // ← 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';
|
||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||
|
|
@ -978,8 +978,7 @@ const App = (() => {
|
|||
|
||||
// ----------------------------------------------------------
|
||||
// ----------------------------------------------------------
|
||||
// VERSION-CHECK — persistentes Banner wenn neue Version verfügbar
|
||||
// ----------------------------------------------------------
|
||||
// VERSION-CHECK
|
||||
let _updateBannerShown = false;
|
||||
|
||||
async function _checkVersion() {
|
||||
|
|
@ -1050,16 +1049,14 @@ const App = (() => {
|
|||
const btn = banner.querySelector('#upd-btn-reload');
|
||||
btn.textContent = 'Lädt…';
|
||||
btn.disabled = true;
|
||||
sessionStorage.setItem('by_update_reload', APP_VER);
|
||||
// ?_t= Timestamp zwingt iOS bfcache zur Aufgabe — wird beim Start sofort entfernt
|
||||
setTimeout(() => location.replace('/?_t=' + Date.now()), 800);
|
||||
try {
|
||||
const reg = await navigator.serviceWorker?.getRegistration();
|
||||
if (reg?.waiting) reg.waiting.postMessage({ type: 'SKIP_WAITING' });
|
||||
reg?.update().catch(() => {}); // kein await — kann hängen
|
||||
// Alle SW deregistrieren + alle Caches löschen → sauberer Neustart
|
||||
const regs = await navigator.serviceWorker?.getRegistrations() ?? [];
|
||||
await Promise.all(regs.map(r => r.unregister()));
|
||||
const keys = await caches.keys();
|
||||
await Promise.all(keys.map(k => caches.delete(k)));
|
||||
} catch { /* ignorieren */ }
|
||||
location.replace('/?_t=' + Date.now());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -741,7 +741,7 @@ window.Worlds = (() => {
|
|||
border-radius:16px;padding:10px 4px 8px;height:80px;box-sizing:border-box;
|
||||
display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
|
||||
cursor:grab;position:relative;min-width:0;overflow:hidden;
|
||||
user-select:none;-webkit-tap-highlight-color:transparent;touch-action:none">
|
||||
user-select:none;-webkit-tap-highlight-color:transparent;touch-action:pan-y">
|
||||
${!c.pinned ? `
|
||||
<button class="wc-remove" data-page="${c.page}" data-zone="${w}"
|
||||
style="position:absolute;top:-10px;right:-10px;width:30px;height:30px;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Offline-Cache + Push Notifications + Tile-Cache
|
||||
============================================================ */
|
||||
|
||||
const CACHE_VERSION = 'by-v786';
|
||||
const CACHE_VERSION = 'by-v791';
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue