fix: NaN library components are out of sync [FC-0083] (#1864)
This commit is contained in:
@@ -34,7 +34,7 @@ export const OutOfSyncAlert: React.FC<OutOfSyncAlertProps> = ({
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const { data, isLoading } = useEntityLinksSummaryByDownstreamContext(courseId);
|
||||
const outOfSyncCount = data?.reduce((count, lib) => count + lib.readyToSyncCount, 0);
|
||||
const outOfSyncCount = data?.reduce((count, lib) => count + (lib.readyToSyncCount || 0), 0);
|
||||
const alertKey = `outOfSyncCountAlert-${courseId}`;
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
{
|
||||
"upstreamContextTitle": "CS problems",
|
||||
"upstreamContextKey": "lib:OpenedX:CSPROB",
|
||||
"readyToSyncCount": 0,
|
||||
"totalCount": 3
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user