Skip to content

Commit

Permalink
refactor(index.page.tsx): update dependencies for useEffect hook to i…
Browse files Browse the repository at this point in the history
…nclude zkappWorkerClient for proper re-rendering
  • Loading branch information
ymekuria committed Sep 23, 2024
1 parent 262b8ab commit 16d3399
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default function Home() {
const zkappWorkerClient = new ZkappWorkerClient();
setZkappWorkerClient(zkappWorkerClient);
await new Promise((resolve) => setTimeout(resolve, 5000));

displayStep('Done loading web worker')

await zkappWorkerClient.setActiveInstanceToDevnet();
Expand All @@ -51,12 +50,10 @@ export default function Home() {
displayStep(`Using key:${publicKeyBase58}`);

displayStep('Checking if fee payer account exists...');

const res = await zkappWorkerClient.fetchAccount(
publicKeyBase58,
);
const accountExists = res.error === null;

setAccountExists(accountExists);

await zkappWorkerClient.loadContract();
Expand Down Expand Up @@ -113,7 +110,7 @@ export default function Home() {
};

checkAccountExists();
}, [hasBeenSetup, accountExists]);
}, [zkappWorkerClient, hasBeenSetup, accountExists]);

// -------------------------------------------------------
// Send a transaction
Expand Down

0 comments on commit 16d3399

Please sign in to comment.