Skip to content

Commit

Permalink
fix(coinify sell trade details modal)
Browse files Browse the repository at this point in the history
  • Loading branch information
sixtedemaupeou committed May 29, 2018
1 parent 5dc7fe7 commit adb88f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const ButtonRow = styled.div`
const Trade = ({ trade, close }) => {
const headerStatus = statusHelper(trade.state)
const bodyStatus = bodyStatusHelper(trade.state, trade.isBuy)
console.log(trade)
const details = tradeDetails.renderDetails(trade)

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,19 @@ export const reviewOrder = {
export const tradeDetails = {
renderDetails: (trade) => {
const fiat = trade.inCurrency !== 'BTC' ? trade.inCurrency : trade.outCurrency
const symbol = currencySymbolMap[fiat]
if (trade.isBuy) {
const symbol = currencySymbolMap[fiat]
return {
firstRow: `${trade.receiveAmount} BTC (${symbol}${(trade.inAmount / 100).toFixed(2)})`,
fee: `${symbol}${((trade.sendAmount / 100) - (trade.inAmount / 100)).toFixed(2)}`,
total: `${symbol}${(trade.sendAmount / 100).toFixed(2)}`
}
} else {
return {
firstRow: `${trade.sendAmount / 1e8} BTC (${symbol}${(trade.outAmountExpected / 100).toFixed(2)})`,
fee: `${symbol}${((trade.outAmountExpected / 100) - trade.receiveAmount).toFixed(2)}`,
total: `${symbol}${(trade.receiveAmount).toFixed(2)}`
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/blockchain-wallet-v4/src/redux/data/coinify/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,9 @@ export default ({ api, options }) => {
const sell = function * () {
try {
yield put(A.handleTradeLoading())
console.log('core saga sell')
const account = yield select(S.getAccount)
const sellResult = yield apply(account, account.sell)
yield put(A.handleTradeSuccess(sellResult))
console.log('coinify sell result in core', sellResult)
yield put(A.fetchTrades())
yield call(getCoinify)
return sellResult
Expand Down

0 comments on commit adb88f5

Please sign in to comment.