Skip to content

Commit

Permalink
Fix bug introduced when addressing reviews, and remove unnecessary m.…
Browse files Browse the repository at this point in the history
…isCancel check
  • Loading branch information
norwnd committed Apr 11, 2023
1 parent e2ddc69 commit 6240b94
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions client/webserver/site/src/js/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,7 @@ export default class OrderPage extends BasePage {
* updated on each update to the match.
*/
setMutableMatchCardElements (matchCard: HTMLElement, m: Match) {
if (m.isCancel) {
return
}
if (m.isCancel) return

const tmpl = Doc.parseTemplate(matchCard)
tmpl.status.textContent = OrderUtil.matchStatusString(m)
Expand Down Expand Up @@ -313,13 +311,13 @@ export default class OrderPage extends BasePage {
}
Doc.hide(tmpl.refundCoin)
Doc.show(tmpl.refundPending)
return
} else {
tmpl.refundCoin.textContent = formatCoinID(m.refund.stringID)
tmpl.refundCoin.dataset.explorerCoin = m.refund.stringID
setCoinHref(m.refund.assetID, tmpl.refundCoin)
Doc.show(tmpl.refundCoin)
Doc.hide(tmpl.refundPending)
}
tmpl.refundCoin.textContent = formatCoinID(m.refund.stringID)
tmpl.refundCoin.dataset.explorerCoin = m.refund.stringID
setCoinHref(m.refund.assetID, tmpl.refundCoin)
Doc.show(tmpl.refundCoin)
Doc.hide(tmpl.refundPending)

if (m.status === OrderUtil.MakerSwapCast && !m.revoked && !m.refund) {
const c = makerSwapCoin(m)
Expand All @@ -341,7 +339,6 @@ export default class OrderPage extends BasePage {
Doc.show(tmpl.takerRedeemMsg)
} else {
Doc.hide(tmpl.makerSwapMsg, tmpl.takerSwapMsg, tmpl.makerRedeemMsg, tmpl.takerRedeemMsg)
if (m.isCancel) return
}

if (!m.revoked) {
Expand Down

0 comments on commit 6240b94

Please sign in to comment.