Skip to content

Commit

Permalink
site: Fix order marker bug (#2448)
Browse files Browse the repository at this point in the history
* site: fix bug in market.js

    - MetaOrder.status was not set but was used in other parts of the code,
      This oversight prevented markers from being set the first time
      an order changes it's status to Booked.
  • Loading branch information
ukane-philemon authored Jul 26, 2023
1 parent bd9266a commit 4ab15ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/webserver/site/src/html/bodybuilder.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=b4acdc88|6df2b7a9"></script>
<script src="/js/entry.js?v=028e1498|b813f78d"></script>
</body>
</html>
{{end}}
6 changes: 3 additions & 3 deletions client/webserver/site/src/js/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ interface MetaOrder {
details: Record<string, PageElement>
ord: Order
cancelling?: boolean
status?: number
}

interface CancelData {
Expand Down Expand Up @@ -2271,10 +2270,11 @@ export default class MarketsPage extends BasePage {
// previously not "ready to tick" (due to its wallets not being connected
// and unlocked) has now become ready to tick. The active orders section
// needs to be refreshed.
if (!mord || note.topic === 'AsyncOrderFailure' || (note.topic === 'OrderLoaded' && order.readyToTick)) {
const wasInflight = note.topic === 'AsyncOrderFailure' || note.topic === 'AsyncOrderSubmitted'
if (!mord || wasInflight || (note.topic === 'OrderLoaded' && order.readyToTick)) {
return this.refreshActiveOrders()
}
const oldStatus = mord.status
const oldStatus = mord.ord.status
mord.ord = order
if (note.topic === 'MissedCancel') Doc.show(mord.details.cancelBttn)
if (order.filled === order.qty) Doc.hide(mord.details.cancelBttn)
Expand Down

0 comments on commit 4ab15ac

Please sign in to comment.