Refresh env UI on trade-mode change; hide hedge review tabs in options mode.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -248,8 +248,22 @@
|
||||
return "持平";
|
||||
}
|
||||
|
||||
function tradeModeFromDom() {
|
||||
var tabs = document.querySelector(".or-tabs");
|
||||
return (tabs && tabs.getAttribute("data-okx-trade-mode")) || "options";
|
||||
}
|
||||
|
||||
function defaultSourceForMode(mode) {
|
||||
if (mode === "options_options") return "options_options";
|
||||
if (mode === "perp_options") return "perp_options";
|
||||
return "option_spot";
|
||||
}
|
||||
|
||||
function setActiveTab(source) {
|
||||
activeSource = source || "option_spot";
|
||||
var mode = tradeModeFromDom();
|
||||
var allowed = defaultSourceForMode(mode);
|
||||
activeSource = source || allowed;
|
||||
if (activeSource !== allowed) activeSource = allowed;
|
||||
tradesPage = 0;
|
||||
reviewedPage = 0;
|
||||
document.querySelectorAll(".or-tab").forEach(function (btn) {
|
||||
@@ -1312,7 +1326,7 @@
|
||||
hideJournalForm();
|
||||
hideDetail();
|
||||
hardenSearchAutofill();
|
||||
setActiveTab("option_spot");
|
||||
setActiveTab(defaultSourceForMode(tradeModeFromDom()));
|
||||
}
|
||||
|
||||
function hardenSearchAutofill() {
|
||||
|
||||
Reference in New Issue
Block a user