Skip to content

Commit

Permalink
handle avoiding extra re-renders by negating ethSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammed-Mamoun98 committed Dec 10, 2024
1 parent 34a12cd commit 28d819d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/idos-data-dashboard/src/core/idos/idos-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const Provider = ({ children }: PropsWithChildren) => {
}

return null;
}, [ethSigner, selector]);
}, [!!ethSigner, selector]);

const initialise = useCallback(async () => {
const signer = await getSigner();
Expand All @@ -55,7 +55,6 @@ export const Provider = ({ children }: PropsWithChildren) => {
url: import.meta.env.VITE_IDOS_ENCLAVE_URL,
},
});

const profile = await _sdk.hasProfile(userAddress);
setHasProfile(profile);

Expand All @@ -66,9 +65,8 @@ export const Provider = ({ children }: PropsWithChildren) => {

setPublicKey(_pk);
}

setSdk(_sdk);
}, [getSigner, userAddress, sdk]);
}, [getSigner, !!sdk]);

useEffect(() => {
initialise()
Expand Down

0 comments on commit 28d819d

Please sign in to comment.