fix: mainRef vor Early Returns (React Hooks Rule)

This commit is contained in:
2026-06-13 18:12:29 +02:00
parent 7758487c9f
commit 8784f607cb

View File

@@ -3268,6 +3268,7 @@ export default function App() {
if (_shareMatch) return <PublicFileShare token={_shareMatch[1]}/>; if (_shareMatch) return <PublicFileShare token={_shareMatch[1]}/>;
const mobile = useIsMobile(); const mobile = useIsMobile();
const mainRef = useRef(null);
const [splash, setSplash] = useState(() => { const [splash, setSplash] = useState(() => {
// Only show splash in standalone PWA mode, and only once per session // Only show splash in standalone PWA mode, and only once per session
return window.matchMedia('(display-mode: standalone)').matches && !sessionStorage.getItem('splash_shown'); return window.matchMedia('(display-mode: standalone)').matches && !sessionStorage.getItem('splash_shown');
@@ -3348,7 +3349,6 @@ export default function App() {
if(!user) return <Login onLogin={u=>setUser(u)}/>; if(!user) return <Login onLogin={u=>setUser(u)}/>;
const activeTool = TOOLS.find(t=>t.id===active); const activeTool = TOOLS.find(t=>t.id===active);
const mainRef = useRef(null);
// Mobile padding bottom für fixed nav // Mobile padding bottom für fixed nav
const isNachrichten = active === 'nachrichten'; const isNachrichten = active === 'nachrichten';