From 6c44b1bcd7dc212a75c11490f34c83f1b12e1839 Mon Sep 17 00:00:00 2001 From: Anthony Nweke <75612396+Anthonyslav@users.noreply.github.com> Date: Mon, 20 Jun 2022 22:33:36 +0100 Subject: [PATCH] Update index.js --- src/components/mint/index.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/components/mint/index.js b/src/components/mint/index.js index 33c6cbf..bd71f8c 100644 --- a/src/components/mint/index.js +++ b/src/components/mint/index.js @@ -46,15 +46,20 @@ class MintNFT extends React.Component { const { ethereum } = window; if (ethereum) { +if(location.protocol !== 'https:') { + // https://ethereum.stackexchange.com/a/62217/620 + const alert = document.querySelector("#alert-error-https"); + alert.style.display = "block"; + document.querySelector("#btn-connect").setAttribute("disabled", "disabled") + return; + } + const providerOptions = { // binancechainwallet: { // package: binancechainwallet // }, walletconnect: { package: WalletConnectProvider, - options: { - infuraId: "0bbb45846bdf44d1bcbe6275327619ad" - } }, walletlink: { package: WalletLink, @@ -69,7 +74,19 @@ const providerOptions = { } }, }; - + fortmatic: { + package: Fortmatic, + options: { + // Mikko's TESTNET api key + key: "pk_test_391E26A3B43A3350" + } + } + }; + web3Modal = new Web3Modal({ + cacheProvider: false, // optional + providerOptions, // required + disableInjectedProvider: false, // optional. For MetaMask / Brave / Opera. + });