JavaScript conditional statement

Description of the problem: I can’t load my experiment to Pavlovia (stuck on “initialising the experiment”), and found the source of the issue in a JS code component, but I can’t figure out why it’s causing an issue.

When I comment it out and replace with older code, it works fine. It’s the second if-statement that causes the issue:

if (((typeof radio._markerPos != 'undefined') && (! pausing))){
    startTime = t;
    console.log(startTime);
    pausing =  true;
    }

if (((pausing) && (t > startTime + 0.1))){
    if ((rightRating == 1)){
        continueRoutine = false;
        } else {
            if ((rightRating == 2)) {
                continueRoutine = true;
            }

For reference, this is coded on each frame, and the python code is slightly different - as I understand it, online clicking the radio ends the routine without showing the response, so this allows for showing the radio response for 100ms before ending the routine. The python code on the same component is as follows and works fine on local:

if radio.rating: 
    if rightRating == 1:
        continueRoutine = False
    elif rightRating == 2:
        continueRoutine = True

I’m not super familiar with JS, any help would be greatly appreciated.