Created
May 20, 2020 11:16
-
-
Save alexroan/9d68bedc1e90b7e1f872568fcdd9d3e7 to your computer and use it in GitHub Desktop.
loadWeb3.js
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
export const loadWeb3 = async (dispatch) => { | |
dispatch(loggingIn()); | |
let web3 = null; | |
try{ | |
web3 = await getWeb3(); | |
dispatch(loggedIn(web3)); | |
loadAccount(dispatch, web3); | |
} | |
catch(error) { | |
dispatch(loginFailed(error)); | |
} | |
return web3; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment