Skip to content

Commit

Permalink
main: Display Sidebar(If Disabled) for single Org users
Browse files Browse the repository at this point in the history
Signed-off-by: tarun8718 <tarunkumar8718@gmail.com>
  • Loading branch information
tarun8718 committed Apr 3, 2021
1 parent 2a0f9b3 commit 6deb388
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/renderer/js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,23 @@ class ServerManagerView {
});

ipcRenderer.on('open-settings', async (event: Event, settingNav: string) => {
let numberServers = 0;
for (const tab of this.tabs) {
if (tab.props.role === 'server') {
numberServers++;
}
}

if (numberServers === 1) {
const value = ConfigUtil.getConfigItem('showSidebar');
if (!value) {
const newValue = !value;
this.toggleSidebar(newValue);
this.updateGeneralSettings('toggle-sidebar-setting', newValue);
ConfigUtil.setConfigItem('showSidebar', newValue);
}
}

await this.openSettings(settingNav);
});

Expand Down

0 comments on commit 6deb388

Please sign in to comment.