Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Philemon Ukane <[email protected]>
  • Loading branch information
ukane-philemon committed Aug 28, 2023
1 parent 7d5c826 commit 89b6712
Show file tree
Hide file tree
Showing 3 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 @@ -103,7 +103,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=c8e99f90|57d459a0"></script>
<script src="/js/entry.js?v=a72e5d84|9d363229"></script>
</body>
</html>
{{end}}
2 changes: 1 addition & 1 deletion client/webserver/site/src/js/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ export default class MarketsPage extends BasePage {
market order rate.
*/
marketOrderRateString (ord: Order, mkt: CurrentMarket) :string {
if (!ord.matches) return intl.prep(intl.ID_MARKET_ORDER)
if (!ord.matches?.length) return intl.prep(intl.ID_MARKET_ORDER)
let rateStr = Doc.formatRateFullPrecision(OrderUtil.averageRate(ord), mkt.baseUnitInfo, mkt.quoteUnitInfo, mkt.cfg.ratestep)
if (ord.matches.length > 1) rateStr = '~ ' + rateStr // ~ only makes sense if the order has more than one match
return rateStr
Expand Down
4 changes: 2 additions & 2 deletions client/webserver/site/src/js/orderutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function settled (order: Order) {
/* averageRateString returns a formatting string containing the average rate of
the matches that have been filled for a market order. */
export function averageMarketOrderRateString (ord: Order): string {
if (!ord.matches) return intl.prep(intl.ID_MARKET_ORDER)
if (!ord.matches?.length) return intl.prep(intl.ID_MARKET_ORDER)
let rateStr = Doc.formatCoinValue(app().conventionalRate(ord.baseID, ord.quoteID, averageRate(ord)))
if (ord.matches.length > 1) rateStr = '~ ' + rateStr // "~" only makes sense if the order has more than one match.
return rateStr
Expand All @@ -132,7 +132,7 @@ export function averageMarketOrderRateString (ord: Order): string {
/* averageRate returns a the average rate of the matches that have been filled
in an order. */
export function averageRate (ord: Order): number {
if (!ord.matches) return 0
if (!ord.matches?.length) return 0
let rateProduct = 0
let baseQty = 0
for (const m of ord.matches) {
Expand Down

0 comments on commit 89b6712

Please sign in to comment.