提交 61e2423e 编写于 作者: S Sandeep Somavarapu

Update to new state if there is no current state

上级 59432df8
......@@ -617,12 +617,15 @@ export class ViewsViewlet extends PanelViewlet {
}
private updateViewStateSize(view: ViewsViewletPanel): void {
if (this.didLayout) {
const currentState = this.viewsStates.get(view.id);
const newViewState = this.createViewState(view);
const stateToUpdate = currentState ? { ...currentState, collapsed: newViewState.collapsed, size: newViewState.size } : newViewState;
this.viewsStates.set(view.id, stateToUpdate);
const currentState = this.viewsStates.get(view.id);
if (currentState && !this.didLayout) {
// Do not update to new state if the layout has not happened yet
return;
}
const newViewState = this.createViewState(view);
const stateToUpdate = currentState ? { ...currentState, collapsed: newViewState.collapsed, size: newViewState.size } : newViewState;
this.viewsStates.set(view.id, stateToUpdate);
}
protected createViewState(view: ViewsViewletPanel): IViewState {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册