Skip to content

Commit

Permalink
fix(coinify sell history expired trades)
Browse files Browse the repository at this point in the history
  • Loading branch information
sixtedemaupeou committed May 29, 2018
1 parent adb88f5 commit 0c0950f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const renderStatus = (status, isBuy) => {
case 'rejected': return <FormattedMessage id='scenes.buysellorderhistory.list.orderstatus.rejected' defaultMessage='Rejected' />
case 'failed': return <FormattedMessage id='scenes.buysellorderhistory.list.orderstatus.failed' defaultMessage='Failed' />
case 'cancelled': return <FormattedMessage id='scenes.buysellorderhistory.list.orderstatus.cancelled' defaultMessage='Cancelled' />
case 'expired': return <FormattedMessage id='scenes.buysellorderhistory.list.orderstatus.expired' defaultMessage='Expired' />
default: return <FormattedMessage id='scenes.buysellorderhistory.list.orderstatus.unknown' defaultMessage='Unknown' />
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ export default ({ coreSagas }) => {

const sell = function * () {
try {
const trade = yield call(coreSagas.data.coinify.sell)
yield put(A.coinifyLoading())
const trade = yield call(coreSagas.data.coinify.sell)

if (!trade) {
const trade = yield select(selectors.core.data.coinify.getTrade)
Expand All @@ -85,21 +85,15 @@ export default ({ coreSagas }) => {
} else {
payment = yield payment.to(trade.receiveAddress)
}
payment = yield payment.description(`Exchange Trade COINIFY=${trade.id}`)

try {
payment = yield payment.build()
} catch (e) {
yield put(actions.logs.logErrorMessage(logLocation, 'sell', e))
}
payment = yield payment.description(`Exchange Trade COINIFY=${trade.id}`)
payment = yield payment.build()

yield put(sendBtcActions.sendBtcPaymentUpdated(Remote.of(payment.value())))
const password = yield call(promptForSecondPassword)
payment = yield payment.sign(password)
payment = yield payment.publish()

yield put(sendBtcActions.sendBtcPaymentUpdated(Remote.of(payment.value())))

yield put(A.coinifySuccess())
yield put(actions.form.change('buySellTabStatus', 'status', 'order_history'))
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ 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 @@ -197,7 +197,6 @@ export default ({ api, options }) => {
const accounts = yield apply(mediums[medium], mediums[medium].getAccounts)
const buyResult = yield apply(accounts[0], accounts[0].buy)
yield put(A.handleTradeSuccess(buyResult))
console.log('coinify buy result in core', buyResult)
yield put(A.fetchTrades())
yield call(getCoinify)
return buyResult
Expand Down

0 comments on commit 0c0950f

Please sign in to comment.