diff --git a/src/components/Screen/Screen.jsx b/src/components/Screen/Screen.jsx index ed72ccf..27c0a6a 100644 --- a/src/components/Screen/Screen.jsx +++ b/src/components/Screen/Screen.jsx @@ -49,7 +49,7 @@ export default function Text({promptVisible: promptEnabled, handleCommand, showR } if(outputRef.current) { - setImmediate(() => outputRef.current.scrollTop = outputRef.current.scrollHeight) + setTimeout(() => outputRef.current.scrollTop = outputRef.current.scrollHeight, 0) setCurrentScroll(outputRef.current.scrollHeight) } } @@ -100,7 +100,7 @@ export default function Text({promptVisible: promptEnabled, handleCommand, showR // Scroll after unpaused useEffect(() => { - setImmediate(() => outputRef.current.scrollTop = outputRef.current.scrollHeight) + setTimeout(() => outputRef.current.scrollTop = outputRef.current.scrollHeight, 0) setCurrentScroll(outputRef.current.scrollHeight) }, [currentPause]) diff --git a/src/gameSetup/2-phases-and-hints.ts b/src/gameSetup/2-phases-and-hints.ts index cdaa813..fcaa844 100644 --- a/src/gameSetup/2-phases-and-hints.ts +++ b/src/gameSetup/2-phases-and-hints.ts @@ -43,6 +43,6 @@ hints.set(Phase.returnedUpToBathroom, 'Someone locked the comms room locker. Th hints.set(Phase.hasKey, `You've retrieved the spare key to the comms locker, and can finally get the capacitor to repair the mainframe.`) hints.set(Phase.unlockedLocker, 'Locker is empty - whoever was in your ship made sure you wouldn\'t be able to repair it.') -setImmediate(() => { +setTimeout(() => { game.createProperty('gamePhase', Phase.wakeUp) -}) +}, 0) diff --git a/src/gameSetup/3-game-rules.ts b/src/gameSetup/3-game-rules.ts index e458e46..6bc0f9a 100644 --- a/src/gameSetup/3-game-rules.ts +++ b/src/gameSetup/3-game-rules.ts @@ -393,7 +393,7 @@ rules.onBeforeCommand(command => { if(game.getProperty('gamePhase') === Phase.hasKey) { renderer.endGame() - setImmediate(() => rules.emit('gameEnd')) + setTimeout(() => rules.emit('gameEnd'), 0) throw new Error() }