@lvce-editor/main-area-worker 9.43.0 → 9.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2728,9 +2728,14 @@ const closeTabsRight = (state, groupId) => {
|
|
|
2728
2728
|
layout
|
|
2729
2729
|
} = state;
|
|
2730
2730
|
const {
|
|
2731
|
+
activeGroupId,
|
|
2731
2732
|
groups
|
|
2732
2733
|
} = layout;
|
|
2733
|
-
const
|
|
2734
|
+
const targetGroupId = groupId ?? activeGroupId;
|
|
2735
|
+
if (targetGroupId === -1) {
|
|
2736
|
+
return state;
|
|
2737
|
+
}
|
|
2738
|
+
const group = getGroupById(state, targetGroupId);
|
|
2734
2739
|
if (!group) {
|
|
2735
2740
|
return state;
|
|
2736
2741
|
}
|
|
@@ -2749,7 +2754,7 @@ const closeTabsRight = (state, groupId) => {
|
|
|
2749
2754
|
if (newTabs.length === tabs.length) {
|
|
2750
2755
|
return state;
|
|
2751
2756
|
}
|
|
2752
|
-
const groupIndex = groups.findIndex(g => g.id ===
|
|
2757
|
+
const groupIndex = groups.findIndex(g => g.id === targetGroupId);
|
|
2753
2758
|
const closedTabs = tabs.slice(activeTabIndex + 1).map((tab, index) => ({
|
|
2754
2759
|
group,
|
|
2755
2760
|
groupIndex,
|
|
@@ -2757,7 +2762,7 @@ const closeTabsRight = (state, groupId) => {
|
|
|
2757
2762
|
tabIndex: activeTabIndex + index + 1
|
|
2758
2763
|
}));
|
|
2759
2764
|
const newGroups = groups.map(g => {
|
|
2760
|
-
if (g.id ===
|
|
2765
|
+
if (g.id === targetGroupId) {
|
|
2761
2766
|
return {
|
|
2762
2767
|
...g,
|
|
2763
2768
|
isEmpty: newTabs.length === 0,
|
|
@@ -4507,7 +4512,7 @@ const getGroupSegments = (groups, parentDirection) => {
|
|
|
4507
4512
|
index++;
|
|
4508
4513
|
}
|
|
4509
4514
|
segments.push({
|
|
4510
|
-
direction: group.direction,
|
|
4515
|
+
direction: nestedGroups.length === 1 ? undefined : group.direction,
|
|
4511
4516
|
groups: nestedGroups,
|
|
4512
4517
|
startIndex
|
|
4513
4518
|
});
|