Fix: Tier-Wechsel auf eigenen Account → sofortiges Worlds-Re-render ohne Reload (SW by-v739)

This commit is contained in:
rene 2026-05-06 19:25:25 +02:00
parent c027573e10
commit e3d3802829
5 changed files with 14 additions and 5 deletions

View file

@ -946,7 +946,16 @@ window.Page_admin = (() => {
UI.modal.close();
try {
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();
} catch (e) { UI.toast.error(e.message); }
});