Skip to content

Commit 6466e5f

Browse files
committed
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.
1 parent 266ed11 commit 6466e5f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

app/renderer/js/main.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@ export class ServerManagerView {
622622
});
623623
this.$settingsButton.classList.add("active");
624624
this.preferenceView!.handleNavigation(navigationItem);
625+
626+
// We always want to show the sidebar in case of the settings page.
627+
this.toggleSidebar(true);
625628
}
626629

627630
async openAbout(): Promise<void> {
@@ -714,6 +717,12 @@ export class ServerManagerView {
714717
this.loading.has((await tab.webview).properties.url),
715718
);
716719

720+
// We might be coming here from the settings page, which has the
721+
// sidebar always enabled. We need to recheck that setting here
722+
// and toggle the sidebar as needed.
723+
const showSidebar = ConfigUtil.getConfigItem("showSidebar", true);
724+
this.toggleSidebar(showSidebar);
725+
717726
ipcRenderer.send("update-menu", {
718727
// JSON stringify this.tabs to avoid a crash
719728
// util.inspect is being used to handle circular references
@@ -793,6 +802,11 @@ export class ServerManagerView {
793802
}
794803

795804
toggleSidebar(show: boolean): void {
805+
// In case when user manually clicks on toggleSidebar.
806+
if (this.tabs[this.activeTabIndex]?.properties?.page === "Settings") {
807+
show = true;
808+
}
809+
796810
this.$sidebar.classList.toggle("sidebar-hide", !show);
797811
}
798812

0 commit comments

Comments
 (0)