Fix chart viewport regressions from tail refresh and period switch.
Remove pendingViewportEpoch, fetch only 30 tail bars on poll, restore wasViewingTail logic, and fix left-scroll range shift from actual merge delta. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -652,6 +652,7 @@ def api_chart_ohlcv(
|
||||
symbol: str = "",
|
||||
timeframe: str = "1d",
|
||||
refresh: str = "",
|
||||
tail: str = "",
|
||||
limit: int = 0,
|
||||
before_ms: str = "",
|
||||
):
|
||||
@@ -665,6 +666,7 @@ def api_chart_ohlcv(
|
||||
raise HTTPException(status_code=400, detail="请输入币种")
|
||||
ex_key = str(ex.get("key") or "").strip().lower()
|
||||
force = (refresh or "").strip().lower() in ("1", "true", "yes", "on")
|
||||
tail_refresh = (tail or "").strip().lower() in ("1", "true", "yes", "on")
|
||||
lim = int(limit) if int(limit or 0) > 0 else None
|
||||
bms_raw = (before_ms or "").strip()
|
||||
bms = None
|
||||
@@ -690,6 +692,7 @@ def api_chart_ohlcv(
|
||||
timeframe,
|
||||
remote_fetch,
|
||||
force_refresh=force,
|
||||
tail_refresh=tail_refresh,
|
||||
limit=lim,
|
||||
before_ms=bms,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user