Last active
January 14, 2019 12:09
-
-
Save ylv-io/99bacf49200a3cf8ec0d21419cfe2dd8 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
| // web3 has to be injected/present | |
| if (web3js) { | |
| if (web3js.eth.accounts.length) { | |
| // if not locked, get account | |
| const account = web3js.eth.accounts[0]; | |
| // updates UI, state, pull data | |
| } else { | |
| // locked. update UI. Ask user to unlock. | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment