diff --git a/public/index.html b/public/index.html index 9c0da95..6b0655d 100644 --- a/public/index.html +++ b/public/index.html @@ -1717,24 +1717,24 @@ -
+
@@ -1750,15 +1750,14 @@
BLAIR
-
Ghost Investigation Dashboard for Blair  ·  made by non_player1 & qiqi.june -
+
Ghost Investigation Dashboard  ·  Made by non_player1 & qiqi.june
@@ -1782,7 +1781,7 @@
-
Evidence Filter — single-click: found  ·  twice: excluded
+
Evidence Filter — einmal: gefunden  ·  zweimal: ausgeschlossen
@@ -2043,24 +2042,43 @@ /* ── INIT ── */ async function init() { + // Gast-Button Event hier setzen (kein inline onclick nötig) + document.getElementById('guest-btn').addEventListener('click', guestMode); + showLoading("Lade..."); - const r = await fetch('/auth/me'); - const { user } = await r.json(); - currentUser = user; + try { + const r = await fetch('/auth/me'); + if (!r.ok) throw new Error('auth failed'); + const { user } = await r.json(); + currentUser = user; - if (!user) { hideLoading(); showLogin(); return; } + if (!user) { + hideLoading(); + return; // login-screen ist schon sichtbar (show class per default) + } - await loadGhosts(); - setupUI(); - hideLoading(); - document.getElementById('app').style.display = 'block'; + await loadGhosts(); + setupUI(); + hideLoading(); + hideLogin(); // erst jetzt verstecken + document.getElementById('app').style.display = 'block'; + } catch (e) { + hideLoading(); + console.error('Init error:', e); + // Login screen bleibt sichtbar + } } function guestMode() { hideLogin(); + showLoading("Lade..."); loadGhosts().then(() => { + hideLoading(); setupGuestUI(); document.getElementById('app').style.display = 'block'; + }).catch(e => { + hideLoading(); + console.error(e); }); }