Skip to content

Commit c382319

Browse files
devvaannshabose
authored andcommitted
fix: git and terminal selected states are incorrect
1 parent 6390718 commit c382319

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/extensions/default/Git/src/Panel.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,14 +1528,14 @@ define(function (require, exports) {
15281528
}
15291529
});
15301530

1531-
// When any bottom panel is shown (container is visible),
1532-
// re-select the git icon if git panel is still open.
15331531
WorkspaceManager.on(WorkspaceManager.EVENT_WORKSPACE_PANEL_SHOWN, function (event, panelID) {
1534-
if (Main.$icon && Preferences.get("panelEnabled")) {
1535-
Main.$icon.toggleClass("on", true);
1536-
Main.$icon.toggleClass("selected-button", true);
1537-
CommandManager.get(Constants.CMD_GIT_TOGGLE_PANEL).setChecked(true);
1532+
if (!Main.$icon) {
1533+
return;
15381534
}
1535+
const isGitActive = (panelID === "main-git.panel");
1536+
Main.$icon.toggleClass("on", isGitActive);
1537+
Main.$icon.toggleClass("selected-button", isGitActive);
1538+
CommandManager.get(Constants.CMD_GIT_TOGGLE_PANEL).setChecked(isGitActive);
15391539
});
15401540

15411541
exports.init = init;

src/extensionsIntegrated/Terminal/main.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,9 +898,7 @@ define(function (require, exports, module) {
898898

899899
const PanelView = require("view/PanelView");
900900
PanelView.on(PanelView.EVENT_PANEL_SHOWN, function (_event, panelId) {
901-
if (panelId === PANEL_ID) {
902-
$btn.addClass("selected-button");
903-
}
901+
$btn.toggleClass("selected-button", panelId === PANEL_ID);
904902
});
905903
PanelView.on(PanelView.EVENT_PANEL_HIDDEN, function (_event, panelId) {
906904
if (panelId === PANEL_ID || panelId === WorkspaceManager.DEFAULT_PANEL_ID) {

0 commit comments

Comments
 (0)