From 6d5a49196dd960146bf8b519c996db8ec61ff1c0 Mon Sep 17 00:00:00 2001 From: NFish Date: Fri, 18 Apr 2025 13:32:45 +0800 Subject: [PATCH] fix: refetch app detail after set access --- web/app/components/app-sidebar/app-info.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/app/components/app-sidebar/app-info.tsx b/web/app/components/app-sidebar/app-info.tsx index b14a6b5e47..1d791b9d15 100644 --- a/web/app/components/app-sidebar/app-info.tsx +++ b/web/app/components/app-sidebar/app-info.tsx @@ -19,7 +19,7 @@ import { useStore as useAppStore } from '@/app/components/app/store' import { ToastContext } from '@/app/components/base/toast' import AppsContext, { useAppContext } from '@/context/app-context' import { useProviderContext } from '@/context/provider-context' -import { copyApp, deleteApp, exportAppConfig, updateAppInfo } from '@/service/apps' +import { copyApp, deleteApp, exportAppConfig, fetchAppDetail, updateAppInfo } from '@/service/apps' import DuplicateAppModal from '@/app/components/app/duplicate-modal' import type { DuplicateAppModalProps } from '@/app/components/app/duplicate-modal' import CreateAppModal from '@/app/components/explore/create-app-modal' @@ -185,6 +185,12 @@ const AppInfo = ({ expand }: IAppInfoProps) => { setShowAccessControl(true) setOpen(false) }, [appDetail]) + const handleAccessControlUpdate = useCallback(() => { + fetchAppDetail({ url: '/apps', id: appDetail!.id }).then((res) => { + setAppDetail(res) + setShowAccessControl(false) + }) + }, [appDetail, setAppDetail]) const { isCurrentWorkspaceEditor } = useAppContext() @@ -481,7 +487,7 @@ const AppInfo = ({ expand }: IAppInfoProps) => { )} { showAccessControl && { setShowAccessControl(false) }} + onConfirm={handleAccessControlUpdate} onClose={() => { setShowAccessControl(false) }} /> }