diff --git a/backend/static/index.html b/backend/static/index.html index 576a25e..1924588 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -22,8 +22,8 @@ - - + + @@ -269,9 +269,9 @@ - - - + + + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index c9fecc7..799a717 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '80'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '81'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const App = (() => { diff --git a/backend/static/js/pages/friends.js b/backend/static/js/pages/friends.js index 7e56b46..61adb19 100644 --- a/backend/static/js/pages/friends.js +++ b/backend/static/js/pages/friends.js @@ -22,6 +22,16 @@ window.Page_friends = (() => { // HAUPT-RENDER // ---------------------------------------------------------- function _render(prefill = null) { + if (!_appState.user) { + _container.innerHTML = UI.emptyState({ + icon: UI.icon('users'), + title: 'Anmelden erforderlich', + text: 'Melde dich an, um Freunde zu finden und Anfragen zu verwalten.', + action: ``, + }); + return; + } + const myName = _appState?.user?.name || ''; const myLink = `${location.origin}/#friends?suche=${encodeURIComponent(myName)}`; @@ -147,13 +157,14 @@ window.Page_friends = (() => { // DATEN LADEN // ---------------------------------------------------------- async function _loadFriends() { + if (!_appState.user) return; try { const data = await API.friends.list(); _renderIncoming(data.incoming || []); _renderOutgoing(data.outgoing || []); _renderFriends(data.friends || []); _updateBadge((data.incoming || []).length); - } catch { /* 401 wird vom Auth-Guard abgefangen */ } + } catch { /* silent — 401 bei abgemeldeter Session */ } } function _updateBadge(count) { @@ -413,6 +424,7 @@ window.Page_friends = (() => { // SUCHE // ---------------------------------------------------------- async function _doSearch(q) { + if (!_appState.user) return; const el = _container.querySelector('#fr-search-results'); try { const results = await API.friends.search(q); @@ -462,6 +474,7 @@ window.Page_friends = (() => { // AKTIONEN // ---------------------------------------------------------- async function _sendRequest(userId, btn) { + if (!_appState.user) { App.navigate('settings'); return; } btn.disabled = true; btn.innerHTML = ``; try { @@ -514,6 +527,7 @@ window.Page_friends = (() => { } async function _openChat(userId) { + if (!_appState.user) { App.navigate('settings'); return; } try { const { conversation_id } = await API.chat.start(userId); App.navigate('chat', true, { conversation_id }); diff --git a/backend/static/sw.js b/backend/static/sw.js index 98d96ed..f640cb8 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v104'; +const CACHE_VERSION = 'by-v105'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten