fix: scroll content-body to top on route change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-07 22:22:51 +02:00
parent 4182b67732
commit c1624342d3
+5
View File
@@ -126,6 +126,11 @@ function AppShell() {
}; };
}, [isLoggedIn, activeServerId, setMusicFolders]); }, [isLoggedIn, activeServerId, setMusicFolders]);
// Reset scroll position on route change
useEffect(() => {
document.querySelector('.content-body')?.scrollTo({ top: 0 });
}, [location.pathname]);
// Auto-navigate to offline library when no connection but cached content exists // Auto-navigate to offline library when no connection but cached content exists
const prevConnStatus = useRef(connStatus); const prevConnStatus = useRef(connStatus);
useEffect(() => { useEffect(() => {