diff --git a/.circleci/config.yml b/.circleci/config.yml index f6a04f64..53bd8dca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,7 @@ jobs: deploy_stage: docker: - image: cimg/node:14.17.3 + resource_class: medium+ steps: - checkout - run: rm yarn.lock && yarn install --network-concurrency 1 @@ -10,9 +11,11 @@ jobs: - run: ssh -oStrictHostKeyChecking=no -v $EC2_PROD_USER@$EC2_PROD_IP "sh /home/ubuntu/remove.sh reactdemo-staging" - run: scp -oStrictHostKeyChecking=no -v -r /home/circleci/project/build/* $EC2_PROD_USER@$EC2_PROD_IP:/home/ubuntu/reactdemo-staging/ - run: ssh -oStrictHostKeyChecking=no -v $EC2_PROD_USER@$EC2_PROD_IP "sh /home/ubuntu/move.sh reactdemo-staging" + deploy_prod: docker: - image: cimg/node:14.17.3 + resource_class: medium+ steps: - checkout - run: yarn cache clean && yarn install --network-concurrency 1 diff --git a/package.json b/package.json index ca3c5d84..aad8176d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "onboard-notify-react", - "version": "0.13.2", + "version": "0.13.3", "dependencies": { "bnc-notify": "^1.9.1", "bnc-notify-staging": "https://github.com/blocknative/notify#develop", diff --git a/src/App.js b/src/App.js index 1a8dffbb..1f2df723 100644 --- a/src/App.js +++ b/src/App.js @@ -5,6 +5,7 @@ import getSigner from './signer' import { initOnboard, initNotify } from './services' import { version, dependencies } from '../package.json' import avatarPlaceholder from './avatar-placeholder.png' +import networkEnum from './networkEnum' import './App.css' @@ -34,7 +35,7 @@ const internalTransferABI = [ let internalTransferContract -function App() { +const App = () => { const [address, setAddress] = useState(null) const [ens, setEns] = useState(null) const [network, setNetwork] = useState(null) @@ -86,16 +87,15 @@ function App() { }, []) useEffect(() => { - const previouslySelectedWallet = window.localStorage.getItem( - 'selectedWallet' - ) + const previouslySelectedWallet = + window.localStorage.getItem('selectedWallet') if (previouslySelectedWallet && onboard) { onboard.walletSelect(previouslySelectedWallet) } }, [onboard]) - async function readyToTransact() { + const readyToTransact = async () => { if (!provider) { const walletSelected = await onboard.walletSelect() if (!walletSelected) return false @@ -105,7 +105,7 @@ function App() { return ready } - async function sendHash() { + const sendHash = async () => { if (!toAddress) { alert('An Ethereum address to send Eth to is required.') return @@ -136,7 +136,7 @@ function App() { emitter.on('txFailed', console.log) } - async function sendInternalTransaction() { + const sendInternalTransaction = async () => { if (!toAddress) { alert('An Ethereum address to send Eth to is required.') return @@ -159,7 +159,7 @@ function App() { emitter.on('txFailed', console.log) } - async function sendTransaction() { + const sendTransaction = async () => { if (!toAddress) { alert('An Ethereum address to send Eth to is required.') } @@ -171,13 +171,15 @@ function App() { value: 1000000000000000 } - const sendTransaction = () => - signer.sendTransaction(txDetails).then(tx => tx.hash) + const sendTransaction = () => { + return signer.sendTransaction(txDetails).then(tx => tx.hash) + } const gasPrice = () => provider.getGasPrice().then(res => res.toString()) - const estimateGas = () => - provider.estimateGas(txDetails).then(res => res.toString()) + const estimateGas = () => { + return provider.estimateGas(txDetails).then(res => res.toString()) + } const { emitter } = await notify.transaction({ sendTransaction, @@ -203,7 +205,9 @@ function App() { emitter.on('txFailed', console.log) } - return onboard && notify ? ( + if (!onboard || !notify) return