Skip to content

Commit

Permalink
Check if approved
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Usman committed Nov 5, 2018
1 parent ae2cf62 commit 032f3c2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/assets/v2/js/metamask-approval.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
disabled = [ '/', '/how/funder', '/how/contributor', '/tools' ];

async function metamaskApproval() {
if (window.ethereum) {
window.web3 = new Web3(ethereum);
var approved = await window.ethereum._metamask.isApproved();
try {
if ($.inArray(window.location.pathname, disabled) == -1) {
if (approved) {
await ethereum.enable();
}
} catch (error) {
Expand Down

0 comments on commit 032f3c2

Please sign in to comment.