Skip to content

Commit

Permalink
fix: incorrect path for course files in root directories
Browse files Browse the repository at this point in the history
  • Loading branch information
umbopepato committed Feb 24, 2024
1 parent a1cad0c commit f2a18aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/features/courses/components/CourseFileListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,15 @@ export const CourseFileListItem = memo(
}
return [
courseFilesCache,
item.location?.substring(1),
item.location?.substring(1), // Files in the top-level directory have an empty location, hence the `filter(Boolean)` below
[filename ? `${filename} (${item.id})` : item.id, ext]
.filter(notNullish)
.join('.'),
].join('/');
]
.filter(Boolean)
.join('/');
}, [courseFilesCache, item]);

const {
isDownloaded,
downloadProgress,
Expand Down

0 comments on commit f2a18aa

Please sign in to comment.