This commit is contained in:
3eef8a28f26fb2bcc514e6f1938929a1f931762 2023-02-11 14:18:26 -05:00
commit 959c2893e5
1 changed files with 1 additions and 2 deletions

View File

@ -26,9 +26,8 @@ const search_helper = function(event) {
// if it is, redirect to it
if(course_exists) {
const loc = window.location.pathname;
// handle both homepage and courses pages
if(loc.substring(0,loc.lastIndexOf('/')) != "/courses") {
if(window.location.pathname.split("/").slice(-2,-1)[0] != "courses") {
location.href = "courses/"+code_str;
} else {
location.href = code_str;