From e3b0f1392396f2ea6844ce25b04b808a34a0486a Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Fri, 4 Aug 2023 11:29:42 +0800 Subject: [PATCH] fix: useVariablesCtx (#2390) --- .../core/client/src/schema-component/common/utils/uitls.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/client/src/schema-component/common/utils/uitls.tsx b/packages/core/client/src/schema-component/common/utils/uitls.tsx index df7b5f0d04..3730d03ffd 100644 --- a/packages/core/client/src/schema-component/common/utils/uitls.tsx +++ b/packages/core/client/src/schema-component/common/utils/uitls.tsx @@ -28,8 +28,8 @@ export const useVariablesCtx = (): VariablesCtx => { const currentUser = useCurrentUserContext(); const { field, service, rowKey } = useTableBlockContext(); const tableData = flattenDeep(service?.data?.data); + const contextData = tableData?.filter((v) => (field?.data?.selectedRowKeys || [])?.includes(v[rowKey])); return useMemo(() => { - const contextData = tableData?.filter((v) => (field?.data?.selectedRowKeys || [])?.includes(v[rowKey])); return { $user: currentUser?.data?.data || {}, $date: {