mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
fix for new tab thing (#792)
This commit is contained in:
parent
466a659ef2
commit
7c2268fb81
@ -302,7 +302,7 @@ export class LayoutModel {
|
|||||||
* Perform an action against the layout tree state.
|
* Perform an action against the layout tree state.
|
||||||
* @param action The action to perform.
|
* @param action The action to perform.
|
||||||
*/
|
*/
|
||||||
treeReducer(action: LayoutTreeAction) {
|
treeReducer(action: LayoutTreeAction, setState = true) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case LayoutTreeActionType.ComputeMove:
|
case LayoutTreeActionType.ComputeMove:
|
||||||
this.setter(
|
this.setter(
|
||||||
@ -369,7 +369,7 @@ export class LayoutModel {
|
|||||||
this.magnifiedNodeId = this.treeState.magnifiedNodeId;
|
this.magnifiedNodeId = this.treeState.magnifiedNodeId;
|
||||||
}
|
}
|
||||||
this.updateTree();
|
this.updateTree();
|
||||||
this.setTreeStateAtom(true);
|
if (setState) this.setTreeStateAtom(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,7 +403,7 @@ export class LayoutModel {
|
|||||||
magnified: action.magnified,
|
magnified: action.magnified,
|
||||||
focused: action.focused,
|
focused: action.focused,
|
||||||
};
|
};
|
||||||
this.treeReducer(insertNodeAction);
|
this.treeReducer(insertNodeAction, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LayoutTreeActionType.DeleteNode: {
|
case LayoutTreeActionType.DeleteNode: {
|
||||||
@ -434,13 +434,16 @@ export class LayoutModel {
|
|||||||
magnified: action.magnified,
|
magnified: action.magnified,
|
||||||
focused: action.focused,
|
focused: action.focused,
|
||||||
};
|
};
|
||||||
this.treeReducer(insertAction);
|
this.treeReducer(insertAction, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LayoutTreeActionType.ClearTree: {
|
case LayoutTreeActionType.ClearTree: {
|
||||||
this.treeReducer({
|
this.treeReducer(
|
||||||
|
{
|
||||||
type: LayoutTreeActionType.ClearTree,
|
type: LayoutTreeActionType.ClearTree,
|
||||||
} as LayoutTreeClearTreeAction);
|
} as LayoutTreeClearTreeAction,
|
||||||
|
false
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -448,6 +451,7 @@ export class LayoutModel {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.setTreeStateAtom(true);
|
||||||
} else {
|
} else {
|
||||||
this.updateTree();
|
this.updateTree();
|
||||||
this.setTreeStateAtom(force);
|
this.setTreeStateAtom(force);
|
||||||
|
Loading…
Reference in New Issue
Block a user