Skip exchange PnL sync on hub iframe soft nav to fix slow records tab.

Remove hover prefetch and mark soft-nav fetches so Gate/OKX render pages from local DB without blocking on exchange history sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-24 00:39:54 +08:00
parent b18b2143b5
commit 813ebf0e4e
10 changed files with 61 additions and 54 deletions
+2 -1
View File
@@ -177,6 +177,7 @@ from order_monitor_display_lib import (
)
from wechat_notify_lib import build_wechat_rs_level_message, send_wechat_webhook
from hub_auth import request_allowed as hub_request_allowed
from instance_nav_lib import request_is_hub_soft_nav
from hub_volume_rank_lib import resolve_daily_volume_rank
from history_window_lib import (
PRESET_CUSTOM,
@@ -6229,7 +6230,7 @@ def render_main_page(page="trade"):
for o in raw_order_list:
order_list.append(enrich_order_item(row_to_dict(o), current_capital))
exchange_pnl_sync = {}
if exchange_private_api_configured():
if exchange_private_api_configured() and not request_is_hub_soft_nav():
try:
exchange_pnl_sync = sync_trade_records_from_exchange(conn) or {}
except Exception as e:
+1 -1
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<script src="/static/instance_theme.js?v=15"></script>
<script src="/static/instance_theme.js?v=16"></script>
<link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
<link rel="stylesheet" href="/static/account_risk_badge.css?v=3">
<script src="/static/account_risk_badge.js?v=3"></script>