Missed this
This commit is contained in:
parent
9a9e16b35a
commit
5f052bb260
23
src/app.jsx
23
src/app.jsx
|
@ -146,15 +146,26 @@ function App() {
|
||||||
return () => clearTimeout(timer);
|
return () => clearTimeout(timer);
|
||||||
};
|
};
|
||||||
useEffect(focusDeck, [location]);
|
useEffect(focusDeck, [location]);
|
||||||
|
const showModal = useMemo(() => {
|
||||||
|
return (
|
||||||
|
snapStates.showCompose ||
|
||||||
|
snapStates.showSettings ||
|
||||||
|
snapStates.showAccount ||
|
||||||
|
snapStates.showDrafts ||
|
||||||
|
snapStates.showMediaModal
|
||||||
|
);
|
||||||
|
}, [
|
||||||
|
snapStates.showCompose,
|
||||||
|
snapStates.showSettings,
|
||||||
|
snapStates.showAccount,
|
||||||
|
snapStates.showDrafts,
|
||||||
|
snapStates.showMediaModal,
|
||||||
|
]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (!showModal) {
|
||||||
!snapStates.showCompose &&
|
|
||||||
!snapStates.showSettings &&
|
|
||||||
!snapStates.showAccount
|
|
||||||
) {
|
|
||||||
focusDeck();
|
focusDeck();
|
||||||
}
|
}
|
||||||
}, [snapStates.showCompose, snapStates.showSettings, snapStates.showAccount]);
|
}, [showModal]);
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// // HACK: prevent this from running again due to HMR
|
// // HACK: prevent this from running again due to HMR
|
||||||
|
|
Loading…
Reference in a new issue