diff --git a/package.json b/package.json index 9c9e229c..e2047a45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "onboard-notify-react", - "version": "0.13.2-0.0.2", + "version": "0.13.2-0.0.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 ca745dd6..1f2df723 100644 --- a/src/App.js +++ b/src/App.js @@ -171,13 +171,15 @@ const 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 @@ const App = () => { emitter.on('txFailed', console.log) } - return onboard && notify ? ( + if (!onboard || !notify) return