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 60ffe60d6..955ef0530 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 @@ -19,7 +19,8 @@ export default function Home() { zkappPublicKeyBase58: '', creatingTransaction: false, }); - + + const [zkappWorkerClient, setZkappWorkerClient] = useState(null); const [displayText, setDisplayText] = useState(''); const [transactionlink, setTransactionLink] = useState(''); @@ -33,6 +34,8 @@ export default function Home() { setDisplayText('Loading web worker...'); console.log('Loading web worker...'); const zkappWorkerClient = new ZkappWorkerClient(); + setZkappWorkerClient(zkappWorkerClient); + await new Promise((resolve) => setTimeout(resolve, 5000)); setDisplayText('Done loading web worker'); @@ -84,7 +87,6 @@ export default function Home() { setState({ ...state, - zkappWorkerClient, hasWallet: true, hasBeenSetup: true, publicKeyBase58,