From 3e70aff84f0d7501fc070e7438ff8ba404a758ac Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Sun, 23 Feb 2020 21:13:53 +0300 Subject: [PATCH] Fix pasting ABI for contract type account --- CHANGELOG.md | 2 ++ old-ui/app/accounts/import/contract.js | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f537de89c..b8d6be530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +- [#318](https://github.com/poanetwork/nifty-wallet/pull/318) - (Fix) pasting of ABI for contract type account + ## 4.11.10 Tue Feb 04 2020 - [#313](https://github.com/poanetwork/nifty-wallet/pull/313) - Change Ethereum classic RPC endpoint diff --git a/old-ui/app/accounts/import/contract.js b/old-ui/app/accounts/import/contract.js index 906984b1f..0e84fa7e9 100644 --- a/old-ui/app/accounts/import/contract.js +++ b/old-ui/app/accounts/import/contract.js @@ -41,13 +41,13 @@ class ContractImportView extends Component { }) } - abiOnChange (abi) { + abiOnChange (abi, APIInputDisabled) { this.props.hideWarning() try { if (abi) { this.setState({ - abi: JSON.stringify(abi), - abiInputDisabled: true, + abi: abi, + abiInputDisabled: APIInputDisabled || false, importDisabled: false, }) } @@ -124,7 +124,15 @@ class ContractImportView extends Component { return } getFullABI(web3.eth, contractAddr, network, type) - .then(finalABI => this.abiOnChange(finalABI)) + .then(finalABI => { + if (finalABI) { + finalABI = JSON.stringify(finalABI) + const APIInputDisabled = true + return this.abiOnChange(finalABI, APIInputDisabled) + } else { + return null + } + }) .catch(e => { this.clearAbi() log.debug(e)