From 316c671c92a2c21bad2ac70e1813ade5d3f650ff Mon Sep 17 00:00:00 2001 From: EYHN Date: Tue, 15 Jul 2025 14:50:54 +0800 Subject: [PATCH] fix(core): error when delete tags (#13207) ## Summary by CodeRabbit * **Refactor** * Adjusted the placement of a conditional check to improve code organization. No changes to user-facing functionality. --- .../core/src/desktop/pages/workspace/tag/index.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/frontend/core/src/desktop/pages/workspace/tag/index.tsx b/packages/frontend/core/src/desktop/pages/workspace/tag/index.tsx index c95b7ffdff..d9783f6a34 100644 --- a/packages/frontend/core/src/desktop/pages/workspace/tag/index.tsx +++ b/packages/frontend/core/src/desktop/pages/workspace/tag/index.tsx @@ -109,11 +109,6 @@ export const TagDetail = ({ tagId }: { tagId?: string }) => { tagId, ]); - if (!currentTag || !tagId) { - return ; - } - - // eslint-disable-next-line react-hooks/rules-of-hooks const handleDisplayPreferenceChange = useCallback( (displayPreference: ExplorerDisplayPreference) => { explorerContextValue.displayPreference$.next(displayPreference); @@ -121,6 +116,10 @@ export const TagDetail = ({ tagId }: { tagId?: string }) => { [explorerContextValue] ); + if (!currentTag || !tagId) { + return ; + } + return (