Skip to content

Commit

Permalink
fix label state changing after init
Browse files Browse the repository at this point in the history
  • Loading branch information
andreacioni committed Oct 15, 2023
1 parent d5b0fce commit dfb00f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webapp/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const LOCAL_STORAGE_PUBLIC_NAME = "public_key";

const GENERATION_WAIT_TIME = 10 * 1000;

const BASE_HOST = "";
const BASE_HOST = "http://localhost:8080";

interface CredentialsResponse {
status: boolean;
Expand Down Expand Up @@ -271,7 +271,7 @@ export default function Home() {
initAsyncAjaxRequestSSE();
didInitUseEffect2 = true;
}
});
}, [sessionId, sessionToken, jsEncryptRef]);

// Load/Generate the key pair.
useEffect(() => {
Expand Down Expand Up @@ -351,12 +351,12 @@ export default function Home() {
const now = new Date();
if (now.getTime() > startTs.getTime() + GENERATION_WAIT_TIME) {
setLabelState("slow_key_generation");
clearInterval(int);
}
}, 1000);
didInitUseEffect3 = true;
return () => clearInterval(int);
}
});
}, [labelState, keySize]);

return (
<main className="container">
Expand Down

0 comments on commit dfb00f2

Please sign in to comment.