From d3282f55de747b34b1940708131abc8396b5c116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=A1=D0=BE=D0=B1=D0=BE?= =?UTF-8?q?=D0=BB=D0=B5=D0=B2?= Date: Mon, 1 Jul 2019 17:44:37 +0300 Subject: [PATCH] Refactored frontend #2 --- frontend/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/index.js b/frontend/index.js index 8fba713..9b14bc0 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -430,6 +430,8 @@ $('button').click(function () { function challengeEthereum(id, data) { console.log('Challenging task N ' + data + ' on Ethereum!'); contractInstance.challenge.sendTransaction(data, function (err, txHash) { - $('#challenge-' + id).text('See tx on Etherscan!').attr("onclick", "window.open('https://rinkeby.etherscan.io/tx/" + txHash + "')"); + if (!err) { + $('#challenge-' + id).text('See tx on Etherscan!').attr("onclick", "window.open('https://rinkeby.etherscan.io/tx/" + txHash + "')"); + } }); }