Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: force list pane to be visible when reveal item in list is called

Abdullah Atta318b95beec9d
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<SplitPaneImperativeHandle>(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 (
<>
<Flex