Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Jun 13, 2018
1 parent 44558a1 commit 8b5824e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/vs/workbench/browser/parts/views/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,12 @@ export class ContributableViewsModel extends Disposable {
for (const viewDescriptor of viewDescriptors) {
const viewState = this.viewStates.get(viewDescriptor.id);
if (viewState) {
if (isUndefinedOrNull(viewState.collapsed)) {
// collapsed state was not set, so set it from view descriptor
viewState.collapsed = !!viewDescriptor.collapsed;
}
// set defaults if not set
viewState.visible = isUndefinedOrNull(viewState.visible) ? !viewDescriptor.hideByDefault : viewState.visible;
viewState.collapsed = isUndefinedOrNull(viewState.collapsed) ? !!viewDescriptor.collapsed : viewState.collapsed;
} else {
this.viewStates.set(viewDescriptor.id, {
visible: true,
visible: !viewDescriptor.hideByDefault,
collapsed: viewDescriptor.collapsed
});
}
Expand Down Expand Up @@ -464,7 +463,7 @@ export class PersistentContributableViewsModel extends ContributableViewsModel {
}
for (const id of Object.keys(storedViewsStates)) {
if (!viewStates.has(id)) {
viewStates.set(id, <IViewState>{ ...storedViewsStates[id], ...{ visible: true } });
viewStates.set(id, <IViewState>{ ...storedViewsStates[id] });
}
}
return viewStates;
Expand Down

0 comments on commit 8b5824e

Please sign in to comment.