Skip to content

Commit 36e5e52

Browse files
fix: resolve type errors and warnings
1 parent fa9194c commit 36e5e52

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/optimizer-page/CourseOptimizerPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const CourseOptimizerPage: FC<{ courseId: string }> = ({ courseId }) => {
151151
size="md"
152152
className="px-4 rounded-0 scan-course-btn"
153153
onClick={() => dispatch(startLinkCheck(courseId))}
154-
disabled={linkCheckInProgress && !errorMessage}
154+
disabled={!!(linkCheckInProgress && !errorMessage)}
155155
>
156156
{linkCheckInProgress && !errorMessage ? (
157157
<>

src/optimizer-page/scan-results/ScanResults.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import SectionCollapsible from './SectionCollapsible';
2121
import PreviousRunSectionCollapsible from './PreviousRunSectionCollapsible';
2222
import BrokenLinkTable from './BrokenLinkTable';
2323
import PreviousRunLinkTable from './PreviousRunLinkTable';
24-
import { LinkCheckResult } from '../types';
24+
import { LinkCheckResult, Section } from '../types';
2525
import { countBrokenLinks } from '../utils';
2626
import FilterModal from './filterModal';
2727
import { useWaffleFlags } from '../../data/apiHooks';
@@ -94,18 +94,18 @@ const ScanResults: FC<Props> = ({ data }) => {
9494
};
9595
};
9696

97-
const vSections = [];
97+
const vSections: Section[] = [];
9898

99-
if (data?.courseUpdates?.length > 0) {
100-
const courseUpdatesSection = createVirtualSection(data.courseUpdates, 'course-updates', 'courseUpdatesHeader');
99+
if (data?.course_updates && data.course_updates.length > 0) {
100+
const courseUpdatesSection = createVirtualSection(data.course_updates, 'course-updates', 'courseUpdatesHeader');
101101
if (courseUpdatesSection) {
102102
vSections.push(courseUpdatesSection);
103103
}
104104
}
105105

106-
if (data?.customPages?.length > 0) {
106+
if (data?.custom_pages && data.custom_pages.length > 0) {
107107
const customPagesSection = createVirtualSection(
108-
data.customPages,
108+
data.custom_pages,
109109
'custom-pages',
110110
'customPagesHeader',
111111
);
@@ -115,7 +115,7 @@ const ScanResults: FC<Props> = ({ data }) => {
115115
}
116116

117117
return vSections;
118-
}, [data?.courseUpdates, data?.customPages, intl]);
118+
}, [data?.course_updates, data?.custom_pages, intl]);
119119

120120
// Combine virtual sections with regular sections
121121
const allSectionsForBrokenLinks = useMemo(

0 commit comments

Comments
 (0)