diff --git a/examples/web/react/app.tsx b/examples/web/react/app.tsx index 0b3baa7186f2c470b0d7467241d04f72e1fe6f8c..e8b7269c0320e20342cdce9b3617d380f92f7acd 100644 --- a/examples/web/react/app.tsx +++ b/examples/web/react/app.tsx @@ -267,6 +267,7 @@ export const App: FC<AppProps> = ({ emulator, backgrounds = ["264653"] }) => { const onBooted = () => { const romInfo = emulator.getRomInfo(); setRomInfo(romInfo); + setPaused(false); }; const onMessage = ( emulator: Emulator, @@ -580,6 +581,7 @@ export const App: FC<AppProps> = ({ emulator, backgrounds = ["264653"] }) => { text={getPauseText()} image={getPauseIcon()} imageAlt="pause" + enabled={paused} style={["simple", "border", "padded"]} onClick={onPauseClick} /> diff --git a/examples/web/react/components/tiles/tiles.tsx b/examples/web/react/components/tiles/tiles.tsx index a74354d7c9bdbfe4bd8759c0836d90ccd497be2c..8ecc57d3b5442758914256df11f0074b0740aaee 100644 --- a/examples/web/react/components/tiles/tiles.tsx +++ b/examples/web/react/components/tiles/tiles.tsx @@ -19,12 +19,14 @@ export const Tiles: FC<TilesProps> = ({ }) => { const classes = () => ["tiles", ...style].join(" "); const onCanvas = (structure: CanvasStructure) => { - setInterval(() => { + const drawTiles = () => { for (let index = 0; index < 384; index++) { const pixels = getTile(index); drawTile(index, pixels, structure); } - }, interval); + }; + drawTiles(); + setInterval(() => drawTiles(), interval); }; return ( <div className={classes()}>