Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrostr committed Sep 7, 2024
1 parent 7f892c4 commit 35237f6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ const Home: NextPage = () => {
const [isVerified, setIsVerified] = useState(false);

useEffect(() => {
if (!fairDrop || !connectedAddress) return;
if (!fairDrop || !connectedAddress || isVerified) return;
const checkIsVerified = async () => {
console.log("Checking if verified");
const _isVerified = await fairDrop.read.isVerified([connectedAddress]);
setIsVerified(_isVerified);
};
checkIsVerified();
}, [fairDrop, isLoading, connectedAddress]);
}, [fairDrop, isLoading, connectedAddress, isVerified]);

return (
<div className="flex flex-col items-center justify-center flex-grow bg-gradient-to-b from-base-200 to-base-300 px-4 py-12">
Expand Down Expand Up @@ -66,7 +67,7 @@ const Home: NextPage = () => {
</div>
</div>
<div className="flex flex-col items-center justify-center space-y-8">
{isLoading ? (
{isLoading || isConnecting ? (
<span className="loading loading-spinner loading-lg"></span>
) : isVerified ? (
<div className="flex flex-col items-center text-success">
Expand Down Expand Up @@ -104,7 +105,7 @@ const Home: NextPage = () => {
{isVerified && (
<div className="mt-8 text-center">
<p className="text-xl font-semibold text-success">Congratulations! The verification was successful</p>
<p className="mt-2 text-base-content/70">You can now proceed with using FairDrop.</p>
<p className="mt-2 text-base-content/70">*Your ID has been cross-chain populated to ...*</p>
</div>
)}
</main>
Expand Down

0 comments on commit 35237f6

Please sign in to comment.