diff --git a/src/components/FileExplorer.tsx b/src/components/FileExplorer.tsx index 5a56763..5ce60d7 100644 --- a/src/components/FileExplorer.tsx +++ b/src/components/FileExplorer.tsx @@ -175,13 +175,13 @@ function ListView({ const listRef = React.useRef(null) const { focusedNode, nodes } = visibleNodes React.useEffect(() => { - if (listRef.current && focusedNode?.path) { + if (listRef.current && focusedNode) { const index = nodes.findIndex(node => node.path === focusedNode.path) if (index !== -1) { listRef.current.scrollToItem(index, 'smart') } } - }, [focusedNode?.path]) + }) const goToCurrentItem = React.useCallback(() => { const targetPath = platform.getCurrentPath(metaData.branchName)