OSDN Git Service

update balances after the rescan
authorZhiting Lin <zlin035@uottawa.ca>
Thu, 15 Nov 2018 02:55:51 +0000 (10:55 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Thu, 15 Nov 2018 02:55:51 +0000 (10:55 +0800)
src/features/balances/actions.js
src/features/balances/components/List.jsx

index fce2f40..56c6a99 100644 (file)
@@ -1,5 +1,6 @@
 import { baseListActions } from 'features/shared/actions'
 import { chainClient } from 'utility/environment'
+import {push} from 'react-router-redux'
 
 const updateInfo = (param) => ({type: 'UPDATE_WALLET_INFO', param})
 
@@ -28,6 +29,7 @@ const walletInfo = () => {
         } else {
           if (info.data.bestBlockHeight === info.data.walletHeight) {
             dispatch({type: 'STOP_RESCAN'})
+            dispatch( push('/balances') )
           }else{
             dispatch(updateInfo(info.data))
           }
index 68d0093..24b4481 100644 (file)
@@ -10,32 +10,8 @@ const type = 'balance'
 
 class List extends React.Component {
   rescanWallet(){
-    // this.props.rescan()
-
-    // debugger
-    // if (this.props.rescanning) {
-    //   window.setTimeout(this.props.info(), 1000)
-    // }
-
-    // let progressInstance = (<ProgressBar now={now} />)
-    // let now = 0
-    //
-    // this.setStat = () => {
-    //   if (this.props.rescanning) {
-    //     this.props.info()
-    //     now = this.props.rescanProgress.bestBlockHeight? this.props.rescanProgress.walletHeight/ this.props.rescanProgress.bestBlockHeight :0
-    //     setTimeout(this.setStat, 1000)
-    //   }else{
-    //     this.props.info()
-    //     console.log('successfully rescan')
-    //   }
-    // }
-
-    // this.setStat()
-
     this.props.showModal(
       <RescanDialog
-        // now={now}
         closeModal = {this.props.closeModal()}
       />
     )