Skip to content

Commit 8c6052d

Browse files
devvaannshabose
authored andcommitted
fix: working set flashing issue on reload when its set to hidden
1 parent 07eb299 commit 8c6052d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/project/SidebarView.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ define(function (require, exports, module) {
188188
function _handleToggleWorkingSet() {
189189
const isCurrentlyShown = PreferencesManager.get("showWorkingSet");
190190
PreferencesManager.set("showWorkingSet", !isCurrentlyShown);
191-
CommandManager.get(Commands.CMD_TOGGLE_SHOW_WORKING_SET).setChecked(isCurrentlyShown);
191+
CommandManager.get(Commands.CMD_TOGGLE_SHOW_WORKING_SET).setChecked(!isCurrentlyShown);
192192
}
193193

194194
/**
@@ -213,6 +213,12 @@ define(function (require, exports, module) {
213213
$projectFilesContainer = $sidebar.find("#project-files-container");
214214
$workingSetViewsContainer = $sidebar.find("#working-set-list-container");
215215

216+
// apply working set visibility immediately
217+
// this is needed because otherwise when the working set is hidden there is a flashing issue
218+
if (!PreferencesManager.get("showWorkingSet")) {
219+
$workingSetViewsContainer.addClass("working-set-hidden");
220+
}
221+
216222
// init
217223
$sidebar.on("panelResizeStart", function (evt, width) {
218224
$sidebar.find(".sidebar-selection-extension").css("display", "none");
@@ -298,6 +304,9 @@ define(function (require, exports, module) {
298304
} else {
299305
$workingSet.addClass("working-set-hidden");
300306
}
307+
308+
// update the menu item checked state to match the preference
309+
_cmdToggleWorkingSet.setChecked(getPref);
301310
});
302311
});
303312

0 commit comments

Comments
 (0)