Skip to content

Commit

Permalink
fix: start watching txs after connect wallet success
Browse files Browse the repository at this point in the history
  • Loading branch information
cazala committed Sep 17, 2018
1 parent e454f3d commit c17f2ad
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/modules/transaction/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ import {
fetchTransactionSuccess,
FETCH_TRANSACTION_REQUEST,
WATCH_PENDING_TRANSACTIONS,
FetchTransactionRequestAction
FetchTransactionRequestAction,
watchPendingTransactions
} from './actions'
import {
CONNECT_WALLET_SUCCESS,
ConnectWalletSuccessAction
} from '../wallet/actions'
import { getData, getLoading } from './selectors'

export function* transactionSaga(): IterableIterator<ForkEffect> {
yield takeEvery(FETCH_TRANSACTION_REQUEST, handleTransactionRequest)
yield takeEvery(WATCH_PENDING_TRANSACTIONS, handleWatchPendingTransactions)
yield takeEvery(CONNECT_WALLET_SUCCESS, handleConnectWalletSuccess)
}

const watchIndex: { [hash: string]: boolean } = {
Expand Down Expand Up @@ -72,3 +78,7 @@ function* handleWatchPendingTransactions() {
}
}
}

function* handleConnectWalletSuccess(_: ConnectWalletSuccessAction) {
yield put(watchPendingTransactions())
}

0 comments on commit c17f2ad

Please sign in to comment.