Skip to content

Commit

Permalink
buck's suggestion
Browse files Browse the repository at this point in the history
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
  • Loading branch information
ukane-philemon committed Apr 19, 2023
1 parent 1fc4e44 commit 0428f1a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions client/webserver/site/src/js/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,7 @@ export default class MarketsPage extends BasePage {
const cache = this.market?.candleCaches[fiveMinBinKey]
if (!cache) {
if (this.candleDur !== fiveMinBinKey) {
this.candleDur = fiveMinBinKey
this.requestCandles()
this.requestCandles(fiveMinBinKey)
return
}
for (const s of this.stats) {
Expand Down Expand Up @@ -2550,8 +2549,10 @@ export default class MarketsPage extends BasePage {
this.requestCandles()
}

/* requestCandles sends the loadcandles request. */
requestCandles () {
/* requestCandles sends the loadcandles request. It accepts an optional candle
* duration which will be requested if it is provided.
*/
requestCandles (candleDur?: string) {
this.candlesLoading = {
loaded: () => { /* pass */ },
timer: window.setTimeout(() => {
Expand All @@ -2562,7 +2563,7 @@ export default class MarketsPage extends BasePage {
}, 10000)
}
const { dex, baseCfg, quoteCfg } = this.market
ws.request('loadcandles', { host: dex.host, base: baseCfg.id, quote: quoteCfg.id, dur: this.candleDur })
ws.request('loadcandles', { host: dex.host, base: baseCfg.id, quote: quoteCfg.id, dur: candleDur || this.candleDur })
}

/*
Expand Down

0 comments on commit 0428f1a

Please sign in to comment.