Fix order_popup flag through SSO and hide stats in hub order popup.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-25 23:38:21 +08:00
parent d8140c6216
commit 347e6b5545
5 changed files with 55 additions and 17 deletions
+15 -9
View File
@@ -419,8 +419,12 @@
async function fetchInstanceOpenUrl(exchangeId, nextPath, opts) {
const options = opts || {};
const next = nextPath || "/";
const q = new URLSearchParams({ exchange_id: String(exchangeId), next });
const q = new URLSearchParams();
q.set("exchange_id", String(exchangeId));
q.set("next", next);
if (options.embed) q.set("embed", "1");
if (options.orderPopup) q.set("order_popup", "1");
if (options.symbol) q.set("symbol", String(options.symbol));
if (options.embed && globalThis.HubTheme && typeof HubTheme.get === "function") {
q.set("hub_theme", HubTheme.get());
}
@@ -493,10 +497,12 @@
async function openOrderPopup(exchangeId, opts) {
const options = opts || {};
const symbol = (options.symbol || "").trim();
let next = "/trade?order_popup=1";
if (symbol) next += "&symbol=" + encodeURIComponent(symbol);
try {
const url = await fetchInstanceOpenUrl(exchangeId, next, { embed: true });
const url = await fetchInstanceOpenUrl(exchangeId, "/trade", {
embed: true,
orderPopup: true,
symbol: symbol || undefined,
});
const row = lastMonitorRows.find((x) => String(x.id) === String(exchangeId));
const title = row ? row.name : exchangeId;
orderPopupCtx = { exchangeId: String(exchangeId), title, symbol };
@@ -539,11 +545,11 @@
const frame = document.getElementById("order-popup-frame");
if (!frame) return;
try {
let next = "/trade?order_popup=1";
if (orderPopupCtx.symbol) {
next += "&symbol=" + encodeURIComponent(orderPopupCtx.symbol);
}
const url = await fetchInstanceOpenUrl(orderPopupCtx.exchangeId, next, { embed: true });
const url = await fetchInstanceOpenUrl(orderPopupCtx.exchangeId, "/trade", {
embed: true,
orderPopup: true,
symbol: orderPopupCtx.symbol || undefined,
});
orderPopupUrl = url;
setOrderPopupLoading(true);
frame.src = url;