Skip to content

Commit

Permalink
fix(onboarding): create hook to toggle tab visibility on focus
Browse files Browse the repository at this point in the history
Refs #346
  • Loading branch information
lpezzolla authored and Bri74 committed Nov 2, 2023
1 parent 3b0ec65 commit f9af8a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/core/queries/courseHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,15 @@ export const useGetCourseLectures = (courseId: number) => {

virtualClassroomsQuery.data?.length &&
lectureSections.push({
courseId,
title: t('common.virtualClassroom_plural'),
type: 'VirtualClassroom',
data: virtualClassroomsQuery.data,
});

videoLecturesQuery.data?.length &&
lectureSections.push({
courseId,
title: t('common.videoLecture_plural'),
type: 'VideoLecture',
data: videoLecturesQuery.data,
Expand All @@ -426,6 +428,7 @@ export const useGetCourseLectures = (courseId: number) => {
const relatedVCs = relatedVCQueries.queries[index].data;
relatedVCs?.length &&
lectureSections.push({
courseId: d.id,
title:
'name' in d
? `${d.name} ${d.year}`
Expand Down
2 changes: 1 addition & 1 deletion src/features/courses/screens/CourseLecturesScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const CourseLecturesScreen = () => {
renderItem={({ section, item: lecture }) => {
return (
<CourseLectureListItem
courseId={courseId}
courseId={section.courseId}
section={section}
lecture={lecture}
/>
Expand Down
1 change: 1 addition & 0 deletions src/features/courses/types/CourseLectureSections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type CourseLecture =
| VideoLecture;

interface BaseLectureTypeSection {
courseId: number;
title: string;
type: 'VirtualClassroom' | 'VideoLecture';
data: CourseLecture[];
Expand Down

0 comments on commit f9af8a8

Please sign in to comment.