From b6a15623573462ace0229c8dd1d0e0c99bfdf6ff Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 23 Oct 2025 17:54:45 +0800 Subject: [PATCH] fix: handle create can not show --- web/app/components/explore/app-list/index.tsx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/web/app/components/explore/app-list/index.tsx b/web/app/components/explore/app-list/index.tsx index 429a40d38a..6b66667486 100644 --- a/web/app/components/explore/app-list/index.tsx +++ b/web/app/components/explore/app-list/index.tsx @@ -108,6 +108,18 @@ const Apps = ({ isFetching, } = useImportDSL() const [showDSLConfirmModal, setShowDSLConfirmModal] = useState(false) + + const isShowTryAppPanel = useContextSelector(ExploreContext, ctx => ctx.isShowTryAppPanel) + const setShowTryAppPanel = useContextSelector(ExploreContext, ctx => ctx.setShowTryAppPanel) + const hideTryAppPanel = useCallback(() => { + setShowTryAppPanel(false) + }, [setShowTryAppPanel]) + const appParams = useContextSelector(ExploreContext, ctx => ctx.currentApp) + const handleShowFromTryApp = useCallback(() => { + setCurrApp(appParams?.app || null) + setIsShowCreateModal(true) + }, [appParams?.app]) + const onCreate: CreateAppModalProps['onConfirm'] = async ({ name, icon_type, @@ -115,6 +127,8 @@ const Apps = ({ icon_background, description, }) => { + hideTryAppPanel() + const { export_data } = await fetchAppDetail( currApp?.app.id as string, ) @@ -143,17 +157,6 @@ const Apps = ({ }) }, [handleImportDSLConfirm, onSuccess]) - const isShowTryAppPanel = useContextSelector(ExploreContext, ctx => ctx.isShowTryAppPanel) - const setShowTryAppPanel = useContextSelector(ExploreContext, ctx => ctx.setShowTryAppPanel) - const hideTryAppPanel = useCallback(() => { - setShowTryAppPanel(false) - }, [setShowTryAppPanel]) - const appParams = useContextSelector(ExploreContext, ctx => ctx.currentApp) - const handleShowFromTryApp = useCallback(() => { - setCurrApp(appParams?.app || null) - setIsShowCreateModal(true) - }, [appParams?.app]) - if (!categories || categories.length === 0) { return (