Skip to content

Commit d415cc0

Browse files
authored
step by step fix (#4357)
1 parent 32992c6 commit d415cc0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

js/activity.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,9 +1553,17 @@ class Activity {
15531553
// Queue and take first step.
15541554
if (!this.turtles.running()) {
15551555
this.logo.runLogoCommands();
1556+
docById("stop").style.color = this.toolbar.stopIconColorWhenPlaying;
15561557
}
15571558
this.logo.step();
15581559
} else {
1560+
1561+
const noBlocks = Object.keys(this.logo.stepQueue).every(key=>this.logo.stepQueue[key].length===0);
1562+
if (noBlocks) {
1563+
this.logo.doStopTurtles();
1564+
docById("stop").style.color = "white";
1565+
return;
1566+
}
15591567
this.logo.turtleDelay = this.TURTLESTEP;
15601568
this.logo.step();
15611569
}

js/toolbar.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,6 @@ class Toolbar {
991991

992992
runStepByStepIcon.onclick = () => {
993993
onclick(this.activity);
994-
docById("stop").style.color = this.stopIconColorWhenPlaying;
995994
};
996995
}
997996

0 commit comments

Comments
 (0)