Skip to content

Commit

Permalink
feat(index.page.tsx): check if wallet is installed in setup method
Browse files Browse the repository at this point in the history
  • Loading branch information
ymekuria committed Sep 19, 2024
1 parent 3375daf commit 9edd889
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions examples/zkapps/04-zkapp-browser-ui/ui/src/pages/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,19 @@ export default function Home() {
setState(prev => ({ ...prev, zkappWorkerClient }));

const setup = async () => {
setState(prev => ({ ...prev, displayText: 'Loading web worker...' }));
setDisplayText('Loading web worker...');
console.log('Loading web worker...');
await zkappWorkerClient.setActiveInstanceToDevnet();

const mina = (window as any).mina;
if (!mina) {
setState(prev => ({ ...prev, hasWallet: false }));
return;
}
};

// (async () => {
// if (!state.hasBeenSetup) {
// setDisplayText('Loading web worker...');
// console.log('Loading web worker...');

// const zkappWorkerClient = new ZkappWorkerClient();
// await timeout(5);

Expand Down

0 comments on commit 9edd889

Please sign in to comment.