Skip to content

Commit

Permalink
feat: initialize worker client before post message
Browse files Browse the repository at this point in the history
  • Loading branch information
ymekuria committed Jul 13, 2023
1 parent a5f9716 commit e3dd791
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,18 @@ export default function App() {
// Do Setup

useEffect(() => {
async function timeout(seconds: number): Promise<void> {
return new Promise<void>((resolve) => {
setTimeout(() => {
resolve();
}, seconds * 1000);
});
}

(async () => {
if (!state.hasBeenSetup) {
const zkappWorkerClient = new ZkappWorkerClient();
await timeout(5);

console.log('Loading SnarkyJS...');
await zkappWorkerClient.loadSnarkyJS();
Expand Down

0 comments on commit e3dd791

Please sign in to comment.