Last active
August 6, 2021 11:26
-
-
Save percybolmer/28873f3fc111f51a5cc1b679ac38017a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
// Only get profile if we are completly loaded | |
if (loaded && (accounts !== 0)) { | |
// get user info | |
console.log(accounts); | |
getUserProfile() | |
} else { | |
// dirty trick to trigger reload if something went wrong | |
setTimeout(setLoaded(true), 500); | |
} | |
// This here subscribes to changes on the loaded and accounts state | |
}, [loaded, accounts]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment