From c3fab488f68d95d57eafb8daf0654e507a528e37 Mon Sep 17 00:00:00 2001 From: Michael An <1822852997@qq.com> Date: Wed, 9 Apr 2025 22:50:14 +0800 Subject: [PATCH] 01 fix create view in folder bug --- frontend/src/metadata/metadata-tree-view/folder.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/metadata/metadata-tree-view/folder.js b/frontend/src/metadata/metadata-tree-view/folder.js index c5b4d376d2..45514c9bad 100644 --- a/frontend/src/metadata/metadata-tree-view/folder.js +++ b/frontend/src/metadata/metadata-tree-view/folder.js @@ -210,12 +210,8 @@ const ViewsFolder = ({ setRenaming(false); }, [folderId, folderName, getFoldersNames, modifyFolder]); - const closeNewView = useCallback(() => { - setNewView(null); - }, []); - const addViewIntoFolder = useCallback((viewName, viewType) => { - addView({ folderId, name: viewName, type: viewType }); + addView({ folderId, name: viewName, type: viewType, successCallback: () => setNewView(null) }); }, [folderId, addView]); const deleteViewFromFolder = useCallback((viewId, isSelected) => { @@ -314,7 +310,7 @@ const ViewsFolder = ({
{expanded && renderViews()} - {newView && } + {newView && }
);