From 6884078d031c80fd844f2fd48584b98ec90ec44d Mon Sep 17 00:00:00 2001 From: Dicken Date: Thu, 18 Jun 2026 16:12:01 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Dashboard=20Auto-Refresh=20bei=20Naviga?= =?UTF-8?q?tion,=20Best=C3=A4tigungs-Badge=20auf=20Favoriten,=20User?= =?UTF-8?q?=E2=86=92Favoriten-Tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.jsx | 10 ++++++---- frontend/src/tools/media.jsx | 11 ++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index ff470a7..02e1a1d 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1988,7 +1988,9 @@ function Dashboard({ toast, mobile, setActive, setDevToolsNav, unreadMsgs=0, unr setActive('media'); setTimeout(()=>window.dispatchEvent(new CustomEvent('media-navigate',{detail:'favoriten'})),80); } else { - api('/tools/media/favorites/user-notify',{method:'POST',body:{}}).then(()=>setUnackedFavs({count:0,isAdmin:false})).catch(()=>{}); + api('/tools/media/favorites/user-notify',{method:'POST',body:{}}) + .then(()=>{ setUnackedFavs({count:0,isAdmin:false}); setActive('media'); setTimeout(()=>window.dispatchEvent(new CustomEvent('media-navigate',{detail:'favoriten'})),80); }) + .catch(()=>{}); } }} style={{ background:'rgba(245,158,11,0.12)', border:'1px solid rgba(245,158,11,0.35)', @@ -3618,9 +3620,8 @@ export default function App() { const [active,setActiveRaw]=useState('dashboard'); const [devToolsNav, setDevToolsNav] = useState(null); const setActive = (page) => { - // Reload nur beim Klick auf Dashboard und nur wenn ein neuer Build vorliegt - // und keine Eingabe aktiv ist (schützt ungespeicherte Eingaben) if (page === 'dashboard' && window.__newBuildAvailable && window.__safeReloadIfNewBuild?.()) return; + if (page === 'dashboard') setDashboardKey(k => k + 1); // Force-Refresh setActiveRaw(page); }; const [toastMsg,setToastMsg]=useState({msg:'',type:'success'}); @@ -3630,6 +3631,7 @@ export default function App() { const [unreadChangelog,setUnreadChangelog]= useState(0); const [unackedFavs, setUnackedFavs] = useState({count:0,isAdmin:false}); const [mediaInitTab, setMediaInitTab] = useState(null); + const [dashboardKey, setDashboardKey] = useState(0); const [authChecked, setAuthChecked] = useState(false); useEffect(()=>{ @@ -3728,7 +3730,7 @@ export default function App() { unreadMsgs={unreadMsgs}/> )}
- {active==='dashboard' && { setUnreadBoard(0); setUnreadPromoted(0); }} unreadChangelog={unreadChangelog} onChangelogRead={()=>setUnreadChangelog(0)} unackedFavs={unackedFavs} user={user}/>} + {active==='dashboard' && { setUnreadBoard(0); setUnreadPromoted(0); }} unreadChangelog={unreadChangelog} onChangelogRead={()=>setUnreadChangelog(0)} unackedFavs={unackedFavs} user={user}/>} {active==='admin' && } {activeTool && setMediaInitTab(null)} : {})}/>}
diff --git a/frontend/src/tools/media.jsx b/frontend/src/tools/media.jsx index 3d5576b..22fa833 100644 --- a/frontend/src/tools/media.jsx +++ b/frontend/src/tools/media.jsx @@ -526,12 +526,21 @@ function SucheGrid({ onOpenModal, xrelIds, onXrelLoaded }) { function FavCard({ f, onOpenModal, onRemove }) { const genres = (() => { try { return JSON.parse(f.genres||'[]'); } catch { return []; } })(); const fskStyle = FSK_COLOR(f.fsk); + const isAcked = !!f.acknowledged && !f.user_notified; return (
onOpenModal({ id: f.tmdb_id, media_type: f.media_type || 'movie' })} style={{ display:'flex', gap:12, alignItems:'flex-start', - background:'rgba(255,255,255,0.03)', border:'1px solid rgba(255,255,255,0.06)', + background: isAcked ? 'rgba(74,222,128,0.05)' : 'rgba(255,255,255,0.03)', + border: `1px solid ${isAcked ? 'rgba(74,222,128,0.25)' : 'rgba(255,255,255,0.06)'}`, borderRadius:8, padding:'10px 12px', cursor:'pointer', position:'relative', }}> + {isAcked && ( +
+ ✓ bestätigt +
+ )}
{f.poster_path ? {f.title}