Skip to content

Commit

Permalink
Merge pull request #126 from Saifullah-dev/125-fix-initial-path-isnt-…
Browse files Browse the repository at this point in the history
…working-correctly

fix(initialPath): change initial path's logic to wait for the files r…
  • Loading branch information
Saifullah-dev authored Dec 30, 2024
2 parents 8109752 + 5238be9 commit 487b888
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/contexts/FileNavigationContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const FileNavigationProvider = ({ children, initialPath }) => {
}, [files, currentPath]);

useEffect(() => {
if (!isMountRef.current) {
if (!isMountRef.current && Array.isArray(files) && files.length > 0) {
setCurrentPath(files.some((file) => file.path === initialPath) ? initialPath : '');
isMountRef.current = true;
}
Expand Down

0 comments on commit 487b888

Please sign in to comment.