Skip to content

Commit 487b888

Browse files
Merge pull request #126 from Saifullah-dev/125-fix-initial-path-isnt-working-correctly
fix(initialPath): change initial path's logic to wait for the files r…
2 parents 8109752 + 5238be9 commit 487b888

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/src/contexts/FileNavigationContext.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const FileNavigationProvider = ({ children, initialPath }) => {
2323
}, [files, currentPath]);
2424

2525
useEffect(() => {
26-
if (!isMountRef.current) {
26+
if (!isMountRef.current && Array.isArray(files) && files.length > 0) {
2727
setCurrentPath(files.some((file) => file.path === initialPath) ? initialPath : '');
2828
isMountRef.current = true;
2929
}

0 commit comments

Comments
 (0)