From fa625ca262fbaf609f82f3278d9c051755f1e1df Mon Sep 17 00:00:00 2001 From: ymekuria Date: Sat, 21 Sep 2024 19:17:11 -0700 Subject: [PATCH] refactor(index.page.tsx): move worker initialization and contract setup into seperate function --- .../zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx b/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx index 401714bfd..c384783df 100644 --- a/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx +++ b/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx @@ -37,7 +37,7 @@ export default function Home() { }); } - (async () => { + async function setup() { if (!state.hasBeenSetup) { setDisplayText('Loading web worker...'); console.log('Loading web worker...'); @@ -103,7 +103,9 @@ export default function Home() { currentNum, }); } - })(); + }; + + setup(); }, []); // -------------------------------------------------------