From 846e28553d3602c4aafb557474f92cf9b7bba71d Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Thu, 27 Mar 2025 13:48:59 +0500 Subject: [PATCH] web: force list pane to be visible when reveal item in list is called --- apps/web/src/app.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app.tsx b/apps/web/src/app.tsx index 34ceaf97a..4ebe12113 100644 --- a/apps/web/src/app.tsx +++ b/apps/web/src/app.tsx @@ -132,7 +132,6 @@ function DesktopAppContents() { const isFocusMode = useStore((store) => store.isFocusMode); const isListPaneVisible = useStore((store) => store.isListPaneVisible); const isTablet = useTablet(); - // const [isNarrow, setIsNarrow] = useState(isTablet || false); const navPane = useRef(null); useEffect(() => { @@ -140,6 +139,23 @@ function DesktopAppContents() { else if (navPane.current?.isCollapsed(0)) navPane.current?.expand(0); }, [isTablet]); + useEffect(() => { + const event = AppEventManager.subscribe( + AppEvents.revealItemInList, + async (id?: string) => { + if (!useStore.getState().isListPaneVisible) { + useStore.getState().toggleListPane(true); + setTimeout(() => { + AppEventManager.publish(AppEvents.revealItemInList, id); + }, 500); + } + } + ); + return () => { + event.unsubscribe(); + }; + }, []); + return ( <>