Skip to content

Commit

Permalink
feat(index.page.tsx): add accountExists dependency to useEffect hook …
Browse files Browse the repository at this point in the history
…to trigger re-render when accountExists changes, ensuring accurate UI display
  • Loading branch information
ymekuria committed Sep 23, 2024
1 parent 38e52f7 commit 0c57586
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ export default function Home() {
await new Promise((resolve) => setTimeout(resolve, 5000));
}
}
// setDisplayText('');
setAccountExists(true);
};

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

// -------------------------------------------------------
// Send a transaction
Expand Down Expand Up @@ -232,8 +233,6 @@ export default function Home() {

let mainContent;
if (hasBeenSetup && accountExists) {
console.log('currentNum test', currentNum);
console.log('current num type', typeof currentNum)
mainContent = (
<div style={{ justifyContent: 'center', alignItems: 'center' }}>
<div className={styles.center} style={{ padding: 0 }}>
Expand Down

0 comments on commit 0c57586

Please sign in to comment.