From c603dabe3b0e7195fc8fe52b7d49bef5f71e4af6 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 7 Jan 2025 04:18:29 +0100 Subject: [PATCH] fix(client): only play scene when ready (#57893) --- client/src/templates/Challenges/components/scene/scene.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/templates/Challenges/components/scene/scene.tsx b/client/src/templates/Challenges/components/scene/scene.tsx index 55128f36e41..a0bda69381e 100644 --- a/client/src/templates/Challenges/components/scene/scene.tsx +++ b/client/src/templates/Challenges/components/scene/scene.tsx @@ -127,7 +127,7 @@ export function Scene({ // TODO: if we manage the playing state in another module, we should not // need the early return here. It should not be possible for this to be // called at all if the scene is already playing. - if (isPlaying) return; + if (isPlaying || !sceneIsReady) return; setIsPlaying(true); setShowDialogue(true); @@ -240,6 +240,7 @@ export function Scene({ isPlaying, duration, sceneSubject, + sceneIsReady, commands, audio, hasTimestamps,