diff --git a/app/assets/v2/js/metamask-approval.js b/app/assets/v2/js/metamask-approval.js index 69750887eb0..94fef0ef7d4 100644 --- a/app/assets/v2/js/metamask-approval.js +++ b/app/assets/v2/js/metamask-approval.js @@ -3,7 +3,7 @@ var is_metamask_approved = is_metamask_approved || false; var is_metamask_unlocked = is_metamask_unlocked || false; async function metamaskApproval() { - if (window.ethereum) { + if (window.ethereum && window.ethereum._metamask) { window.web3 = new Web3(ethereum); is_metamask_approved = await window.ethereum._metamask.isApproved(); is_metamask_unlocked = await window.ethereum._metamask.isUnlocked(); diff --git a/app/assets/v2/js/shared.js b/app/assets/v2/js/shared.js index 502b79d35bc..be2a3279e60 100644 --- a/app/assets/v2/js/shared.js +++ b/app/assets/v2/js/shared.js @@ -991,7 +991,7 @@ var listen_for_web3_changes = async function() { } } - if (window.ethereum && !document.has_checked_for_ethereum_enable) { + if (window.ethereum && !document.has_checked_for_ethereum_enable && window.ethereum._metamask) { document.has_checked_for_ethereum_enable = true; is_metamask_approved = await window.ethereum._metamask.isApproved(); is_metamask_unlocked = await window.ethereum._metamask.isUnlocked();