Skip to content

Commit

Permalink
Merge pull request #29 from javiersuweijie/add-remote-proof-generation
Browse files Browse the repository at this point in the history
feat: use inputWorkers to check if worker is ready
  • Loading branch information
wryonik authored Jul 24, 2024
2 parents ba18978 + bca7b91 commit 7df46f2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/app/src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const CIRCUIT_NAME = "twitter";

export const MainPage: React.FC<{}> = (props) => {
const { address } = useAccount();
const workers = new Map<string, boolean>();

const {
googleAuthToken,
Expand Down Expand Up @@ -199,14 +198,9 @@ export const MainPage: React.FC<{}> = (props) => {
});

useEffect(() => {
if (workers.get("zk-email/proof-of-twitter-v2")) {
return;
if (!inputWorkers["zk-email/proof-of-twitter-v2"]) {
createInputWorker("zk-email/proof-of-twitter-v2");
}
console.log("something")
createInputWorker("zk-email/proof-of-twitter-v2");
console.log("something2")
workers.set("zk-email/proof-of-twitter-v2", true);
// setWorkerReady(true);
}, []);

// local storage stuff
Expand Down Expand Up @@ -543,6 +537,7 @@ export const MainPage: React.FC<{}> = (props) => {
{displayMessage}
</Button>
<Button
disabled={!inputWorkers["zk-email/proof-of-twitter-v2"]}
data-testid="remote-prove-button"
onClick={handleGenerateProofRemotely}
>
Expand Down

0 comments on commit 7df46f2

Please sign in to comment.