Fix: Tier-Wechsel auf eigenen Account → sofortiges Worlds-Re-render ohne Reload (SW by-v739)
This commit is contained in:
parent
c027573e10
commit
e3d3802829
5 changed files with 14 additions and 5 deletions
|
|
@ -327,7 +327,7 @@ MEDIA_DIR = os.getenv("MEDIA_DIR", "/data/media")
|
||||||
os.makedirs(MEDIA_DIR, exist_ok=True)
|
os.makedirs(MEDIA_DIR, exist_ok=True)
|
||||||
app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media")
|
app.mount("/media", StaticFiles(directory=MEDIA_DIR), name="media")
|
||||||
|
|
||||||
APP_VER = "738" # muss mit APP_VER in app.js übereinstimmen
|
APP_VER = "739" # muss mit APP_VER in app.js übereinstimmen
|
||||||
|
|
||||||
@app.get("/api/version")
|
@app.get("/api/version")
|
||||||
async def app_version():
|
async def app_version():
|
||||||
|
|
|
||||||
|
|
@ -578,7 +578,7 @@
|
||||||
<script src="/js/api.js?v=94"></script>
|
<script src="/js/api.js?v=94"></script>
|
||||||
<script src="/js/ui.js?v=94"></script>
|
<script src="/js/ui.js?v=94"></script>
|
||||||
<script src="/js/app.js?v=94"></script>
|
<script src="/js/app.js?v=94"></script>
|
||||||
<script src="/js/worlds.js?v=738"></script>
|
<script src="/js/worlds.js?v=739"></script>
|
||||||
|
|
||||||
<!-- Feature-Seiten werden lazy geladen -->
|
<!-- Feature-Seiten werden lazy geladen -->
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Router, State-Management, Navigation, Initialisierung.
|
Router, State-Management, Navigation, Initialisierung.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const APP_VER = '738'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
const APP_VER = '739'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||||
const APP_VERSION = '1.4.0'; // ← semantische Version, wird bei make release gesetzt
|
const APP_VERSION = '1.4.0'; // ← semantische Version, wird bei make release gesetzt
|
||||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -946,7 +946,16 @@ window.Page_admin = (() => {
|
||||||
UI.modal.close();
|
UI.modal.close();
|
||||||
try {
|
try {
|
||||||
await API.patch(`/admin/users/${uid}`, { subscription_tier: btn.dataset.tier });
|
await API.patch(`/admin/users/${uid}`, { subscription_tier: btn.dataset.tier });
|
||||||
UI.toast.success(`${name}: Abo-Stufe ist jetzt ${btn.dataset.tier}.`);
|
// Eigenes Tier geändert → User-State neu laden + Welten neu rendern
|
||||||
|
if (String(uid) === String(_appState?.user?.id)) {
|
||||||
|
_appState.user.subscription_tier = btn.dataset.tier;
|
||||||
|
if (window.Worlds) {
|
||||||
|
window.Worlds.init(_appState);
|
||||||
|
}
|
||||||
|
UI.toast.success(`Dein Tier ist jetzt ${btn.dataset.tier} — Ansicht aktualisiert.`);
|
||||||
|
} else {
|
||||||
|
UI.toast.success(`${name}: Abo-Stufe ist jetzt ${btn.dataset.tier}.`);
|
||||||
|
}
|
||||||
_renderTab();
|
_renderTab();
|
||||||
} catch (e) { UI.toast.error(e.message); }
|
} catch (e) { UI.toast.error(e.message); }
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Offline-Cache + Push Notifications + Tile-Cache
|
Offline-Cache + Push Notifications + Tile-Cache
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const CACHE_VERSION = 'by-v738';
|
const CACHE_VERSION = 'by-v739';
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue