feat: remove unused hub nav items from user edition.
Drop plan/strategy/help/archive/quotes/logs from top nav and force their display prefs off. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,18 +21,6 @@
|
||||
return displayPref("show_nav_dashboard", true);
|
||||
}
|
||||
|
||||
function showNavPlanPref() {
|
||||
return displayPref("show_nav_plan", true);
|
||||
}
|
||||
|
||||
function showNavArchivePref() {
|
||||
return displayPref("show_nav_archive", true);
|
||||
}
|
||||
|
||||
function showNavQuotesPref() {
|
||||
return displayPref("show_nav_quotes", true);
|
||||
}
|
||||
|
||||
function showNavAiPref() {
|
||||
return displayPref("show_nav_ai", true);
|
||||
}
|
||||
@@ -41,31 +29,13 @@
|
||||
return displayPref("show_nav_calculator", true);
|
||||
}
|
||||
|
||||
function showNavStrategyPref() {
|
||||
return displayPref("show_nav_strategy", true);
|
||||
}
|
||||
|
||||
function showNavHelpPref() {
|
||||
return displayPref("show_nav_help", true);
|
||||
}
|
||||
|
||||
function showNavLogsPref() {
|
||||
return displayPref("show_nav_logs", true);
|
||||
}
|
||||
|
||||
function syncNavVisibility(data) {
|
||||
const d = (data && data.display) || {};
|
||||
const pairs = [
|
||||
["nav-funds", "m-nav-funds", d.show_nav_funds === false],
|
||||
["nav-dashboard", "m-nav-dashboard", d.show_nav_dashboard === false],
|
||||
["nav-plan", "m-nav-plan", d.show_nav_plan === false],
|
||||
["nav-archive", "m-nav-archive", d.show_nav_archive === false],
|
||||
["nav-quotes", "m-nav-quotes", d.show_nav_quotes === false],
|
||||
["nav-ai", "m-tab-ai", d.show_nav_ai === false],
|
||||
["nav-calculator", "m-tab-calculator", d.show_nav_calculator === false],
|
||||
["nav-strategy", "m-nav-strategy", d.show_nav_strategy === false],
|
||||
["nav-help", "m-nav-help", d.show_nav_help === false],
|
||||
["nav-logs", "m-nav-logs", d.show_nav_logs === false],
|
||||
];
|
||||
pairs.forEach(([desktopId, mobileId, hide]) => {
|
||||
const a = document.getElementById(desktopId);
|
||||
@@ -130,14 +100,18 @@
|
||||
function pageNavAllowed(page) {
|
||||
if (page === "funds") return showNavFundsPref();
|
||||
if (page === "dashboard") return showNavDashboardPref();
|
||||
if (page === "plan") return showNavPlanPref();
|
||||
if (page === "archive") return showNavArchivePref();
|
||||
if (page === "quotes") return showNavQuotesPref();
|
||||
if (
|
||||
page === "plan" ||
|
||||
page === "archive" ||
|
||||
page === "quotes" ||
|
||||
page === "strategy" ||
|
||||
page === "help" ||
|
||||
page === "logs"
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (page === "ai") return showNavAiPref();
|
||||
if (page === "calculator") return showNavCalculatorPref();
|
||||
if (page === "strategy") return showNavStrategyPref();
|
||||
if (page === "help") return showNavHelpPref();
|
||||
if (page === "logs") return showNavLogsPref();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -146,25 +120,13 @@
|
||||
const pnlCb = document.getElementById("pref-show-account-pnl");
|
||||
const fundsCb = document.getElementById("pref-show-nav-funds");
|
||||
const dashCb = document.getElementById("pref-show-nav-dashboard");
|
||||
const planCb = document.getElementById("pref-show-nav-plan");
|
||||
const archiveCb = document.getElementById("pref-show-nav-archive");
|
||||
const quotesCb = document.getElementById("pref-show-nav-quotes");
|
||||
const aiCb = document.getElementById("pref-show-nav-ai");
|
||||
const calcCb = document.getElementById("pref-show-nav-calculator");
|
||||
const strategyCb = document.getElementById("pref-show-nav-strategy");
|
||||
const helpCb = document.getElementById("pref-show-nav-help");
|
||||
const logsCb = document.getElementById("pref-show-nav-logs");
|
||||
if (pnlCb) pnlCb.checked = d.show_account_pnl !== false;
|
||||
if (fundsCb) fundsCb.checked = d.show_nav_funds !== false;
|
||||
if (dashCb) dashCb.checked = d.show_nav_dashboard !== false;
|
||||
if (planCb) planCb.checked = d.show_nav_plan !== false;
|
||||
if (archiveCb) archiveCb.checked = d.show_nav_archive !== false;
|
||||
if (quotesCb) quotesCb.checked = d.show_nav_quotes !== false;
|
||||
if (aiCb) aiCb.checked = d.show_nav_ai !== false;
|
||||
if (calcCb) calcCb.checked = d.show_nav_calculator !== false;
|
||||
if (strategyCb) strategyCb.checked = d.show_nav_strategy !== false;
|
||||
if (helpCb) helpCb.checked = d.show_nav_help !== false;
|
||||
if (logsCb) logsCb.checked = d.show_nav_logs !== false;
|
||||
syncNavVisibility(data);
|
||||
}
|
||||
|
||||
@@ -5034,14 +4996,8 @@
|
||||
const pnlCb = document.getElementById("pref-show-account-pnl");
|
||||
const fundsCb = document.getElementById("pref-show-nav-funds");
|
||||
const dashCb = document.getElementById("pref-show-nav-dashboard");
|
||||
const planCb = document.getElementById("pref-show-nav-plan");
|
||||
const archiveCb = document.getElementById("pref-show-nav-archive");
|
||||
const quotesCb = document.getElementById("pref-show-nav-quotes");
|
||||
const aiCb = document.getElementById("pref-show-nav-ai");
|
||||
const calcCb = document.getElementById("pref-show-nav-calculator");
|
||||
const strategyCb = document.getElementById("pref-show-nav-strategy");
|
||||
const helpCb = document.getElementById("pref-show-nav-help");
|
||||
const logsCb = document.getElementById("pref-show-nav-logs");
|
||||
const supEnabled = document.getElementById("supervisor-enabled");
|
||||
const supProg = document.getElementById("supervisor-wechat-program");
|
||||
const supWebhook = document.getElementById("supervisor-wechat-webhook");
|
||||
@@ -5057,14 +5013,14 @@
|
||||
show_account_pnl: pnlCb ? !!pnlCb.checked : true,
|
||||
show_nav_funds: fundsCb ? !!fundsCb.checked : true,
|
||||
show_nav_dashboard: dashCb ? !!dashCb.checked : true,
|
||||
show_nav_plan: planCb ? !!planCb.checked : true,
|
||||
show_nav_archive: archiveCb ? !!archiveCb.checked : true,
|
||||
show_nav_quotes: quotesCb ? !!quotesCb.checked : true,
|
||||
show_nav_plan: false,
|
||||
show_nav_archive: false,
|
||||
show_nav_quotes: false,
|
||||
show_nav_ai: aiCb ? !!aiCb.checked : true,
|
||||
show_nav_calculator: calcCb ? !!calcCb.checked : true,
|
||||
show_nav_strategy: strategyCb ? !!strategyCb.checked : true,
|
||||
show_nav_help: helpCb ? !!helpCb.checked : true,
|
||||
show_nav_logs: logsCb ? !!logsCb.checked : true,
|
||||
show_nav_strategy: false,
|
||||
show_nav_help: false,
|
||||
show_nav_logs: false,
|
||||
},
|
||||
supervisor: {
|
||||
enabled: supEnabled ? !!supEnabled.checked : true,
|
||||
|
||||
Reference in New Issue
Block a user