Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Metamask is no longer exposing accounts by default, so enabling it manually
  • Loading branch information
somesh-banerjee authored Jun 16, 2021
1 parent d8bcfe5 commit 8607ce5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lottery-react/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class App extends Component {

onSubmit = async event => {
event.preventDefault();

await window.ethereum.enable();
const accounts = await web3.eth.getAccounts();

this.setState({ message: 'Waiting on transaction success...' });
Expand All @@ -36,6 +36,7 @@ class App extends Component {
};

onClick = async () => {
await window.ethereum.enable();
const accounts = await web3.eth.getAccounts();

this.setState({ message: 'Waiting on transaction success...' });
Expand Down

0 comments on commit 8607ce5

Please sign in to comment.