Code was working not anymore

Hi Guys, my code was working perfectly in p5js editor since 3 days ago, not sure why ? I was recording mouvement several time and save as preset, but it’s recording only the last record and and what ever preset play the last recording. I hope you can help, thanks. Any update change on the web editor?

Here is the code :

let rotationAngle = 0;
let shouldRotate = false;
let rotationSpeed;
let recording = false;
let playBack = false;
let states = ;
let frameCount = 0;
let presets = ;
let currentPreset;
let dropdown;

function setup() {
createCanvas(400, 400, WEBGL);
rotationSpeed = createSlider(0, 10, 5);
startStopButton = createButton(“Start”);
startStopButton.mousePressed(startStop);
recordButton = createButton(“Record”);
recordButton.mousePressed(startRecord);
playButton = createButton(“Play”);
playButton.mousePressed(startPlayback);
savePresetButton = createButton(“Save Preset”);
savePresetButton.mousePressed(savePreset);
dropdown = createSelect();
dropdown.changed(replayPreset);
}

function draw() {
background(200);

if (recording) {
let state = {
angle: rotationAngle,
speed: rotationSpeed.value(),
rotate: shouldRotate
};
states.push(state);
}

if (playBack) {
if (states.length > 0) {
let state = states[frameCount];
rotationAngle = state.angle;
rotationSpeed.value(state.speed);
shouldRotate = state.rotate;
frameCount++;
if (frameCount == states.length) {
playBack = false;
frameCount = 0;
}
} else {
playBack = false;
}
} else if (shouldRotate) {
rotationAngle += rotationSpeed.value() / 100;
}

rotateX(rotationAngle);
rotateY(rotationAngle);

box(100);
}

function startStop() {
shouldRotate = !shouldRotate;
if (shouldRotate) {
startStopButton.html(“Stop”);
} else {
startStopButton.html(“Start”);
}
}

function startRecord() {
recording = !recording;
if (recording) {
states = ; // clear the array before starting a new recording
recordButton.html(“Stop Record”);
} else {
recordButton.html(“Record”);
}
}

function startPlayback() {
playBack = true;
}

function savePreset() {
let presetName = prompt(“Enter preset name:”);
if (presetName) {
let preset = {
name: presetName,
states: states
};
presets.push(preset);
dropdown.option(presetName);
}
}

function replayPreset() {
currentPreset = presets[dropdown.selected()];
if (currentPreset) {
states = currentPreset.states;
frameCount = 0;
playBack = true;
}
}