From e25e61a70e75f35c6024fd7cac20da6b1071441e Mon Sep 17 00:00:00 2001 From: oxdc <29519076+oxdc@users.noreply.github.com> Date: Tue, 17 Sep 2024 02:21:02 +0800 Subject: [PATCH] added `isSelfTheOnlyChildOfGroup` --- src/components/NavigationContent.tsx | 12 +++--------- src/services/MoveTab.ts | 11 +++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/NavigationContent.tsx b/src/components/NavigationContent.tsx index 1c6e0e2..97f1876 100644 --- a/src/components/NavigationContent.tsx +++ b/src/components/NavigationContent.tsx @@ -19,7 +19,7 @@ import { SortableContext } from "@dnd-kit/sortable"; import { createPortal } from "react-dom"; import * as VT from "src/models/VTWorkspace"; import { - isSelfContainedInGroup, + isSelfTheOnlyChildOfGroup, moveTab, moveTabToEnd, moveTabToNewGroup, @@ -102,13 +102,6 @@ export const NavigationContent = () => { return content.get(groupID); }; - const hasOnlySelf = (groupID: VT.Identifier): boolean => { - return ( - isSelfContainedInGroup(app, groupID) && - content.get(groupID).leafIDs.length == 1 - ); - }; - return (