Skip to content

Commit

Permalink
fix(SFOX): sell core saga adds new trade to metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed May 31, 2018
1 parent 34cd44d commit 9d36683
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/blockchain-wallet-v4/src/redux/data/sfox/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,14 @@ export default ({ api, options }) => {
const methods = yield apply(quote, quote.getPaymentMediums)
const trade = yield apply(methods.ach, methods.ach.sell, [accounts.data[0]])
yield put(A.handleTradeSuccess(trade))

yield put(A.fetchProfile())
yield put(A.fetchTrades())
const trades = yield select(S.getTrades)
yield put(buySellA.setTradesBuySell(trades.data))

// get current kvstore trades, add new trade and set new trades to metadata
const kvTrades = yield select(buySellSelectors.getSfoxTrades)
const newTrades = prepend(trade, kvTrades)
yield put(buySellA.setSfoxTradesBuySell(newTrades))

return trade
} catch (e) {
console.log(e)
Expand Down

0 comments on commit 9d36683

Please sign in to comment.