Skip to content

Commit 85e14c0

Browse files
daDevBoatkexanaDinoxhLSKprSailet03
authored
Prereq oaktree check if prereq course exists (#111)
* sidebar component add * tailwind workin, beggining page building * structure * fixed app * Main design layout * initial sidebar * courseView init * the course page initial tests * Make it run on my comuter * Tree without database integration * fixes * npm update * add to page * Biiiiig Refactoring * Broken version of prereq tree * Fixed not rendering anything. Still broken * Working v1 * handling #prereqs * Test * removed commented out code * More info expands now * More info expands now * More info expands now * Start coding on line 135 in PrereqTreePresenter Mr. PO * Prereqs colored and expands more info * added css styling * Fixed copy bug * Crash fix in PrerequisitePresenter.jsx * merge fix * Prereq tree compression, error handling, debuging, database update * Added null support (hopefully) * Bug fixes * Desplays periods * Bug finally fixed (hopefully) * Check if course exists before doing pop up --------- Co-authored-by: kexana <deotsts@gmail.com> Co-authored-by: Sami Al Saati <sami.alsaati@hotmail.com> Co-authored-by: Kacper Lisik <lisik@kth.se> Co-authored-by: Elias Tosteberg <elias.tosteberg@gmail.com> Co-authored-by: Sailet03 <52610280+Sailet03@users.noreply.github.com>
1 parent 7cd9b9d commit 85e14c0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

my-app/src/presenters/PrerequisitePresenter.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const PrerequisitePresenter = observer((props) => {
132132
let inner_code = arr[1] + arr[2];
133133
let course_name_inner = model.getCourse(inner_code)?.name;
134134
if (!course_name_inner) {
135-
course_name_inner = "Course discontinued"
135+
course_name_inner = "Course discontinued";
136136
}
137137
course_name += "<li>" + inner_code + ": " + course_name_inner + "</li>"
138138
}
@@ -141,7 +141,11 @@ export const PrerequisitePresenter = observer((props) => {
141141
else if (node.data.label === "More Info...") {
142142
course_name = input_text_obj[node["id"]];
143143
} else {
144-
course_name = model.getCourse(course_id).name;
144+
if (model.getCourse(course_id)) {
145+
course_name = model.getCourse(course_id).name;
146+
} else {
147+
course_name = "Course discontinued";
148+
}
145149
}
146150

147151
hover_popup.innerHTML = course_name;

0 commit comments

Comments
 (0)