Skip to content

Commit

Permalink
updated metamask initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniSomoza committed Dec 7, 2021
1 parent 8d5b331 commit e7c5f72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ name: deployment to Github-pages
# events but only for the master branch
on:
push:
branches: [master]
branches:
- main

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -18,7 +19,8 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Checkout
uses: actions/[email protected]

# Send a notification in slack
# - name: Send a start pipeline notification to Slack
Expand All @@ -42,8 +44,8 @@ jobs:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
REACT_APP_CONTRACT_ADDRESS: ${{ secrets.REACT_APP_CONTRACT_ADDRESS }}

- name: deploy-to-github-pages
uses: JamesIves/github-pages-deploy-action@3.6.1
- name: Deploy to Github pages
uses: JamesIves/github-pages-deploy-action@4.1.7
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"react-router-dom": "6",
"react-scripts": "4.0.3",
"styled-components": "^5.3.3",
"web-vitals": "^1.0.1",
"web3": "^1.6.1"
},
"eslintConfig": {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useMetamask.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ function useMetamask() {

// Initialize Metamask instance if its present in the browser
useEffect(() => {
if (!window?.web3?.currentProvider) {
if (!window.ethereum) {
return;
}

const metamaskInstance = new Web3(window.web3.currentProvider);
const metamaskInstance = new Web3(window.ethereum);

setMetamaskInstance(metamaskInstance);
}, []);
Expand Down

0 comments on commit e7c5f72

Please sign in to comment.