code-dot-org / dance-party

Renderer for the Dance game type. Based on p5.js and p5.play.js.
https://code-dot-org.github.io/dance-party/
13 stars 13 forks source link

Remove redundant reset call in playSound onEnded callback #651

Closed fisher-alice closed 1 year ago

fisher-alice commented 1 year ago

This PR pairs with https://github.com/code-dot-org/code-dot-org/pull/53817 which adds the ability to configure a preview for the 'setup' blocks on Dance Party levels.

In this PR within p5.dance.js I removed a call to reset in the onEnded callback for playSound. This is a redundant call to reset and caused an issue when preview is enabled - sometimes, the preview did NOT show up when the 'reset' button is clicked because the playSound onEnded callback which included the reset call would be executed AFTER the preview was drawn.