Skip to content

Commit

Permalink
refactor(index.page.tsx): remove unnecessary IIFE and improve readabi…
Browse files Browse the repository at this point in the history
…lity by defining checkAccountExists function separately
  • Loading branch information
ymekuria committed Sep 23, 2024
1 parent c194997 commit d1302c0
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default function Home() {
// Do Setup

useEffect(() => {

const setup = async () => {
try {
if (!state.hasBeenSetup) {
Expand Down Expand Up @@ -107,7 +106,7 @@ export default function Home() {
// Wait for account to exist, if it didn't

useEffect(() => {
(async () => {
const checkAccountExists = async () => {
if (state.hasBeenSetup && !state.accountExists) {
for (;;) {
setDisplayText('Checking if fee payer account exists...');
Expand All @@ -121,7 +120,9 @@ export default function Home() {
}
setState({ ...state, accountExists: true });
}
})();
};

checkAccountExists();
}, [state.hasBeenSetup]);

// -------------------------------------------------------
Expand Down

0 comments on commit d1302c0

Please sign in to comment.