chuckbergeron / etherplate

🔗 Use this to make your next Ethereum DApp w/ React (& Router), Redux, Bulma & OpenZeppelin ERC721
https://chuckbergeron.io
Other
78 stars 34 forks source link

MetaMask Check sometimes fails #4

Closed chuckbergeron closed 6 years ago

chuckbergeron commented 6 years ago

Race condition: Sometimes we do not have the list of accounts from MetaMask on time when page loads.

Potential Fix:

Add MetaMask checks inside a window.onload function. Alternatively, try to integrate EthLawyer to see if it would be a better fit for Etherplate.

window.onload = function() { // web3 check code go here }

chuckbergeron commented 6 years ago

Cleaned this up and patched the race condition bug in this commit: https://github.com/chuckbergeron/etherplate/commit/d01aaaddce7df108614fae97e4177a33a2a6874c