diff --git a/packages/react-app/pages/index.js b/packages/react-app/pages/index.js index 76e29a1..e12acb9 100644 --- a/packages/react-app/pages/index.js +++ b/packages/react-app/pages/index.js @@ -76,6 +76,9 @@ function Home() { } // handle other "switch" errors } + setTimeout(() => { + window.location.reload(); + }, [1000]); }; const cancelRef = React.useRef(); const [inputEmail, setInputEmail] = useState(""); @@ -123,6 +126,10 @@ function Home() { if (context.injectedProvider && context.injectedProvider.getSigner()) { try { const signer = context.injectedProvider.getSigner(); + const { chainId } = await context.injectedProvider.getNetwork(); + if (chainId !== context.targetNetwork.chainId) { + throw new Error("Incorrect network"); + } const contract = await loadDRecruitV1Contract(context.targetNetwork, signer); const tokenAddress = await contract.token(); const tokenContract = await loadTokenContract(tokenAddress, signer); diff --git a/yarn.lock b/yarn.lock index 3113df2..1374b07 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3779,10 +3779,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers": - version "0.3.0-beta.10" - resolved "https://registry.yarnpkg.com/hardhat-deploy-ethers/-/hardhat-deploy-ethers-0.3.0-beta.10.tgz#bccfcf635d380bbab3638960f6739fe4d396fc5f" - integrity sha512-TeyriUshRZ7XVHOjMsDtTozIrdwLf3Bw+oZRYNhXdG/eut5HeDhjUFPfRlG7TI1lSLvkcB5dt7OxOtPYKDOxTg== +"@nomiclabs/hardhat-ethers@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.3.tgz#06e20a57274f6ce3148132910e723948a711edf1" + integrity sha512-IJ0gBotVtO7YyLZyHNgbxzskUtFok+JkRlKPo8YELqj1ms9XL6Qm3vsfsGdZr22wnJeVEF5TQPotKuwQk21Dag== "@nomiclabs/hardhat-etherscan@^2.1.7": version "2.1.7"