From 10a1f65284699ff3faaae93f9fda74ebf731b160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=AB=E9=9B=A8=E6=B0=B4=E8=BF=87=E6=BB=A4=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E6=B0=94-Rain?= <958414905@qq.com> Date: Mon, 6 Nov 2023 21:18:55 +0800 Subject: [PATCH] fix: button of details is not refresh when updating record (#2977) --- .../core/client/src/schema-component/antd/action/Action.tsx | 4 ++-- .../src/schema-initializer/components/CreateRecordAction.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/action/Action.tsx b/packages/core/client/src/schema-component/antd/action/Action.tsx index 17b737595..aa6540400 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.tsx @@ -2,7 +2,7 @@ import { observer, RecursionField, useField, useFieldSchema, useForm } from '@fo import { isPortalInBody } from '@nocobase/utils/client'; import { App, Button, Popover } from 'antd'; import classnames from 'classnames'; -import { default as lodash, isFunction } from 'lodash'; +import { default as lodash } from 'lodash'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useActionContext } from '../..'; @@ -88,7 +88,7 @@ export const Action: ComposedAction = observer( }); }); }); - }, [JSON.stringify(linkageRules), designable, field]); + }, [field, linkageRules, localVariables, record, variables]); const handleButtonClick = useCallback( (e: React.MouseEvent) => { diff --git a/packages/core/client/src/schema-initializer/components/CreateRecordAction.tsx b/packages/core/client/src/schema-initializer/components/CreateRecordAction.tsx index 070aaf2c9..5ec9d36cf 100644 --- a/packages/core/client/src/schema-initializer/components/CreateRecordAction.tsx +++ b/packages/core/client/src/schema-initializer/components/CreateRecordAction.tsx @@ -111,7 +111,7 @@ export const CreateRecordAction = observer( }); }); }); - }, [JSON.stringify(linkageRules)]); + }, [field, linkageRules, localVariables, variables]); return (