From 7967ff1b0932089ec37b4ef5fd60553eb7a0fae4 Mon Sep 17 00:00:00 2001 From: KatieFrogs <23621460+KatieFrogs@users.noreply.github.com> Date: Sun, 13 Mar 2022 18:31:42 +0300 Subject: [PATCH] Fix fixing courses with p1 and p2 notes --- public/src/js/parsetja.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/src/js/parsetja.js b/public/src/js/parsetja.js index 5a966d4..9291bb2 100644 --- a/public/src/js/parsetja.js +++ b/public/src/js/parsetja.js @@ -67,13 +67,14 @@ if((name === "start" || name === "start p1") && !inSong){ inSong = true - if(!hasSong){ + if(!hasSong || name === "start" && courses[courseName] && courses[courseName].startName !== "start"){ if(!(courseName in courses)){ courses[courseName] = {} } - for(var name in currentCourse){ - if(name !== "branch"){ - courses[courseName][name] = currentCourse[name] + courses[courseName].startName = name + for(var opt in currentCourse){ + if(opt !== "branch"){ + courses[courseName][opt] = currentCourse[opt] } } courses[courseName].start = lineNum + 1