Skip to content

Commit c603dab

Browse files
fix(client): only play scene when ready (freeCodeCamp#57893)
1 parent 553fe95 commit c603dab

File tree

1 file changed

+2
-1
lines changed
  • client/src/templates/Challenges/components/scene

1 file changed

+2
-1
lines changed

client/src/templates/Challenges/components/scene/scene.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export function Scene({
127127
// TODO: if we manage the playing state in another module, we should not
128128
// need the early return here. It should not be possible for this to be
129129
// called at all if the scene is already playing.
130-
if (isPlaying) return;
130+
if (isPlaying || !sceneIsReady) return;
131131
setIsPlaying(true);
132132
setShowDialogue(true);
133133

@@ -240,6 +240,7 @@ export function Scene({
240240
isPlaying,
241241
duration,
242242
sceneSubject,
243+
sceneIsReady,
243244
commands,
244245
audio,
245246
hasTimestamps,

0 commit comments

Comments
 (0)