From ddcad41893ce6d433357588ce86ca56362c9968a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com>
Date: Tue, 1 Nov 2022 22:21:01 +0000
Subject: [PATCH] feat: small improvements

---
 examples/web/react/app.tsx                    | 2 ++
 examples/web/react/components/tiles/tiles.tsx | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/examples/web/react/app.tsx b/examples/web/react/app.tsx
index 0b3baa71..e8b7269c 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 a74354d7..8ecc57d3 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()}>
-- 
GitLab