Skip to content

Commit

Permalink
folder data fix
Browse files Browse the repository at this point in the history
  • Loading branch information
A2Fyise committed Feb 2, 2024
1 parent ce4bc94 commit 3875499
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/app/view/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ const View: React.FC = () => {
const folders = await Api.get(folderApiUrl)
const files = await Api.get(fileApiUrl)

dispatch(setFolders(folders.data));
let folderList
if (+params.id === 0) {
folderList = folders?.data
} else {
folderList = folders?.data[0].children || []
}
dispatch(setFolders(folderList));
setFiles(files.data)
})()
}, [params.id, isTookAction, router])
Expand Down

0 comments on commit 3875499

Please sign in to comment.