From 09f10cbe2ec85018ca603ac593a575e827ad8a57 Mon Sep 17 00:00:00 2001 From: Minh Nguyen <64875104+MinhxNguyen7@users.noreply.github.com> Date: Thu, 26 Oct 2023 23:53:01 -0700 Subject: [PATCH] Grades error does not fail search --- .../components/RightPane/CoursePane/CourseRenderPane.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx b/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx index a326c8c60..2375e8b8b 100644 --- a/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx +++ b/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx @@ -202,7 +202,12 @@ export default function CourseRenderPane(props: { id?: number }) { websocQueryParams.units.includes(',') ? WebSOC.queryMultiple(websocQueryParams, 'units') : WebSOC.query(websocQueryParams), - Grades.populateGradesCache(gradesQueryParams), + // Catch the error here so that the course pane still loads even if the grades cache fails to populate + Grades.populateGradesCache(gradesQueryParams) + .catch((error) => { + console.error(error); + openSnackbar('error', 'Error loading grades information'); + }), ]); setError(false);