Skip to content

Commit

Permalink
Taker should expect Maker redemption to happen any time (after his sw…
Browse files Browse the repository at this point in the history
…ap transaction)
  • Loading branch information
norwnd committed Jan 25, 2023
1 parent 0fdb00c commit c61a71e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/webserver/site/src/js/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,13 @@ export default class OrderPage extends BasePage {

Doc.setVis(!m.isCancel && (makerSwapCoin(m) || !m.revoked), tmpl.makerSwap)
Doc.setVis(!m.isCancel && (takerSwapCoin(m) || !m.revoked), tmpl.takerSwap)
Doc.setVis(!m.isCancel && (makerRedeemCoin(m) || !m.revoked), tmpl.makerRedeem)
// When revoked, there is no need to show maker redeem if we are maker (since
// it won't happen), but if we are taker, maker redeem might still show up
// if maker "doesn't play by server rules" (so we have to account for that).
Doc.setVis(!m.isCancel && (makerRedeemCoin(m) || !m.revoked || (m.revoked && m.side === OrderUtil.Taker)), tmpl.makerRedeem)
// When revoked, there is uncertainty about the taker redeem coin. The taker
// redeem may be needed if maker redeems while taker is waiting to refund.
Doc.setVis(!m.isCancel && (takerRedeemCoin(m) || (!m.revoked && m.active) || ((m.side === OrderUtil.Taker) && m.active && (m.counterRedeem || !m.refund))), tmpl.takerRedeem)
Doc.setVis(!m.isCancel && (takerRedeemCoin(m) || (!m.revoked && m.active) || (m.side === OrderUtil.Taker && m.active && (m.counterRedeem || !m.refund))), tmpl.takerRedeem)
// The refund placeholder should not be shown if there is a counter redeem.
Doc.setVis(!m.isCancel && (m.refund || (m.revoked && m.active && !m.counterRedeem)), tmpl.refund)
}
Expand Down

0 comments on commit c61a71e

Please sign in to comment.