fix closing tab containing multiple panes

This commit is contained in:
ivan 2019-10-13 08:05:54 +08:00 committed by Benjamin Staneck
parent cd655ad1e6
commit 97242c5d78

View file

@ -152,7 +152,9 @@ const replaceParent = (state, parent, child) => {
const removeGroup = (state, uid) => {
const group = state.termGroups[uid];
if (group.parentUid) {
// when close tab with multiple panes, it remove group from parent to child. so maybe the parentUid exists but parent group have removed.
// it's safe to remove the group.
if (group.parentUid && state.termGroups[group.parentUid]) {
const parent = state.termGroups[group.parentUid];
const newChildren = parent.children.filter(childUid => childUid !== uid);
if (newChildren.length === 1) {