Skip to content

Commit

Permalink
delay 2s to get NodeList
Browse files Browse the repository at this point in the history
  • Loading branch information
innerWang committed Jul 16, 2019
1 parent 9226b4f commit ffd7d77
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ NODE_PATH=src

REACT_APP_MAINNET_PROD_API=https://scan.vntchain.io/v1
REACT_APP_MAINNET_PROD_URL=https://scan.vntchain.io/account/
REACT_APP_MAINNET_DEV_API=https://hubscan.vnt.link/v1
REACT_APP_MAINNET_DEV_URL=https://hubscan.vnt.link/v1
REACT_APP_MAINNET_DEV_API=https://scan.vntchain.io/v1
REACT_APP_MAINNET_DEV_URL=https://scan.vntchain.io/account/

REACT_APP_TESTNET_PROD_API=https://hubscan.vnt.link/v1
REACT_APP_TESTNET_PROD_URL=https://hubscan.vnt.link/account/
Expand All @@ -13,4 +13,4 @@ REACT_APP_TESTNET_DEV_URL=https://hubscan.vnt.link/account/


# testnet mainnet
REACT_APP_DEFAULT_NET=testnet
REACT_APP_DEFAULT_NET=mainnet
23 changes: 12 additions & 11 deletions src/component/TxModalQueryResult.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ function TxModalQueryResult(props) {
if (!props.accountAddr.addr) {
message.error('no account addr!')
}
if (receipt.status == '0x1') {
// 代表交易成功 此时需要去重新取rpc的数据
if (receipt.status == '0x1') {
props.dispatch({
type: 'account/setSendResult',
payload: {
Expand All @@ -55,15 +54,17 @@ function TxModalQueryResult(props) {
// 仅需要获取投票
requestRPCData(props.accountAddr.addr, requestType.vote)
}
// 再次获取最新的节点信息
props.dispatch({
type: 'dataRelayNew/fetchData',
payload: {
path: `${apis.nodes}?${getBaseParams(props.nodePageIndex, pageSize)}`,
ns: 'nodes',
field: 'nodes'
}
})
// 再次获取最新的节点信息 等待2s再去取数据,确保浏览器后端数据拿到最新的
setTimeout(() => {
props.dispatch({
type: 'dataRelayNew/fetchData',
payload: {
path: `${apis.nodes}?${getBaseParams(props.nodePageIndex, pageSize)}`,
ns: 'nodes',
field: 'nodes'
}
})
}, 2000)
} else {
// 代表交易失败
props.dispatch({
Expand Down
5 changes: 1 addition & 4 deletions src/models/dataRelayNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ export default {
yield call(callback, ns, result)
}
} catch (e) {
/* eslint-disable */
console.log('%c%s\n%crequest "%s" error', 'color: white; background: #029e74; font-size: 16px;', '________________________', 'color: #ff9200; background: #363636;', path)
console.log(e.message)
/* eslint-enable */
console.error(e.message) // eslint-disable-line
yield put({
type: `${ns}/setState`,
payload: {
Expand Down

0 comments on commit ffd7d77

Please sign in to comment.