From adca406d00bc2d41bcfdf877a7e09c9635589f8c Mon Sep 17 00:00:00 2001 From: viktor Date: Fri, 23 Feb 2018 16:13:37 +0300 Subject: [PATCH] Beautify alerts --- src/App.js | 10 ++++++---- src/getWeb3.js | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/App.js b/src/App.js index 4b86414..b22b4a1 100644 --- a/src/App.js +++ b/src/App.js @@ -13,7 +13,7 @@ import Loading from './Loading'; function generateElement(msg){ let errorNode = document.createElement("div"); - errorNode.innerHTML = `
+ errorNode.innerHTML = `
${msg}
`; return errorNode; @@ -102,9 +102,11 @@ class App extends Component { console.log(isValid); if(Number(isValid) !== 1){ this.setState({loading:false}); - const invalidKeyMsg = `The key is not valid initial Key!
- Please make sure you have loaded correct initial key in metamask.
- Your current selected key is ${initialKey}` + const invalidKeyMsg = `The key is invalid initial Key
+ or you're connect to incorrect chain!
+ Please make sure you have loaded correct initial key in Metamask.

+ Your current selected key is ${initialKey}
+ Current Network ID is ${this.state.web3Config.netId}` swal({ icon: 'error', title: 'Error', diff --git a/src/getWeb3.js b/src/getWeb3.js index b8e6a29..2c01a61 100644 --- a/src/getWeb3.js +++ b/src/getWeb3.js @@ -1,10 +1,10 @@ let errorMsgNoMetamaskAccount = `You haven't chosen any account in MetaMask. -Please, choose your initial key in MetaMask and reload the page. +Please choose your initial key in MetaMask and reload the page. Check POA Network wiki for more info.`; function generateElement(msg){ let errorNode = document.createElement("div"); - errorNode.innerHTML = `
+ errorNode.innerHTML = `
${msg}
`; return errorNode; @@ -33,11 +33,11 @@ let getWeb3 = () => { console.log('This is Core') break default: - netIdName = 'ERROR' + netIdName = 'Unknown' errorMsg = `You aren't connected to POA Network. - Please, switch on POA plugin and refresh the page. + Please switch on Metamask and refresh the page. Check POA Network wiki for more info. - Current Network Id: ${netId}` + Current Network ID is ${netId}` console.log('This is an unknown network.', netId) }