From de8691e4de086c650be6fdc0aaaa4d07e0d76604 Mon Sep 17 00:00:00 2001 From: sxlwar Date: Wed, 4 Aug 2021 17:23:08 +0800 Subject: [PATCH] chore: stupid error (#55) --- src/page/CrossChain/index.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/page/CrossChain/index.js b/src/page/CrossChain/index.js index afe02f3..af93db7 100644 --- a/src/page/CrossChain/index.js +++ b/src/page/CrossChain/index.js @@ -707,9 +707,8 @@ class CrossChain extends Component { const promises = [ethereumGenesisInfo, ethereumToDarwiniaCrossChainInfo]; if (config.IS_DEV) { - promises.push(getErc20TokenLockRecords({ sender: address, row: 200, page: 0 })) - } - Promise.all(promises) + promises.push(getErc20TokenLockRecords({ sender: address, row: 200, page: 0 })); + Promise.all(promises) .then(([genesisHistory, crosschainHistory, erc20CrossChain]) => this.getSymbolMap(erc20CrossChain.list).then(symbolMap => [genesisHistory, crosschainHistory, erc20CrossChain, symbolMap])) .then(([genesisHistory, crosschainHistory, erc20CrossChain, symbolMap]) => { this.setState({ @@ -718,6 +717,16 @@ class CrossChain extends Component { }).catch((error) => { console.log('get history error', error); }) + } else { + Promise.all(promises) + .then(([genesisHistory, crosschainHistory]) => { + this.setState({ + history: [...crosschainHistory.map((item) => ({ ...item, isCrossChain: true })), ...genesisHistory] + }) + }).catch((error) => { + console.log('get history error', error); + }) + } break; case "tron": address = (window.tronWeb && window.tronWeb.address.toHex(account[networkType]))