diff --git a/src/app.jsx b/src/app.jsx index 44ef3d82..f35657eb 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -127,7 +127,9 @@ function App() { }, []); const [currentDeck, setCurrentDeck] = useState('home'); + const [currentModal, setCurrentModal] = useState(null); const focusDeck = () => { + if (currentModal) return; let timer = setTimeout(() => { const page = document.getElementById(`${currentDeck}-page`); console.log('focus', currentDeck, page); @@ -137,7 +139,7 @@ function App() { }, 100); return () => clearTimeout(timer); }; - useEffect(focusDeck, [currentDeck]); + useEffect(focusDeck, [currentDeck, currentModal]); useEffect(() => { if ( !snapStates.showCompose && @@ -173,7 +175,7 @@ function App() { return ( <> - {isLoggedIn && ( + {isLoggedIn && currentDeck && ( <>