From 6466e5f6f6c005ea394574a8a750d792ed5c5c42 Mon Sep 17 00:00:00 2001 From: Shubham Padia Date: Thu, 19 Jun 2025 13:55:43 +0530 Subject: [PATCH] settings: Always show the sidebar in case of settings page. Fixes #1077. Users were getting stuck in the settings page, unable to click on an organisation tab to go back. Enabling the sidebar for settings page in all cases will help ensure that the users can navigate back when needed. --- app/renderer/js/main.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/renderer/js/main.ts b/app/renderer/js/main.ts index 6fb029e34..789f79e98 100644 --- a/app/renderer/js/main.ts +++ b/app/renderer/js/main.ts @@ -622,6 +622,9 @@ export class ServerManagerView { }); this.$settingsButton.classList.add("active"); this.preferenceView!.handleNavigation(navigationItem); + + // We always want to show the sidebar in case of the settings page. + this.toggleSidebar(true); } async openAbout(): Promise { @@ -714,6 +717,12 @@ export class ServerManagerView { this.loading.has((await tab.webview).properties.url), ); + // We might be coming here from the settings page, which has the + // sidebar always enabled. We need to recheck that setting here + // and toggle the sidebar as needed. + const showSidebar = ConfigUtil.getConfigItem("showSidebar", true); + this.toggleSidebar(showSidebar); + ipcRenderer.send("update-menu", { // JSON stringify this.tabs to avoid a crash // util.inspect is being used to handle circular references @@ -793,6 +802,11 @@ export class ServerManagerView { } toggleSidebar(show: boolean): void { + // In case when user manually clicks on toggleSidebar. + if (this.tabs[this.activeTabIndex]?.properties?.page === "Settings") { + show = true; + } + this.$sidebar.classList.toggle("sidebar-hide", !show); }