Skip to content

Commit b30a1c8

Browse files
authored
fix: NaN library components are out of sync [FC-0083] (openedx#1864)
1 parent 855b44f commit b30a1c8

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/course-libraries/OutOfSyncAlert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const OutOfSyncAlert: React.FC<OutOfSyncAlertProps> = ({
3434
}) => {
3535
const intl = useIntl();
3636
const { data, isLoading } = useEntityLinksSummaryByDownstreamContext(courseId);
37-
const outOfSyncCount = data?.reduce((count, lib) => count + lib.readyToSyncCount, 0);
37+
const outOfSyncCount = data?.reduce((count, lib) => count + (lib.readyToSyncCount || 0), 0);
3838
const alertKey = `outOfSyncCountAlert-${courseId}`;
3939

4040
useEffect(() => {

src/course-libraries/__mocks__/linkCourseSummary.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
{
1515
"upstreamContextTitle": "CS problems",
1616
"upstreamContextKey": "lib:OpenedX:CSPROB",
17-
"readyToSyncCount": 0,
1817
"totalCount": 3
1918
}
2019
]

0 commit comments

Comments
 (0)