From 3d1f73fcafc310952c9a93e5c5033d49c6b98886 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Fri, 23 Feb 2024 22:14:57 +0800 Subject: [PATCH] refactor: fixedBlockDesignerItem (#3550) --- .../core/client/src/schema-component/antd/page/FixedBlock.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/client/src/schema-component/antd/page/FixedBlock.tsx b/packages/core/client/src/schema-component/antd/page/FixedBlock.tsx index dd0c3d01e..888630ccc 100644 --- a/packages/core/client/src/schema-component/antd/page/FixedBlock.tsx +++ b/packages/core/client/src/schema-component/antd/page/FixedBlock.tsx @@ -6,6 +6,7 @@ import { useRecord } from '../../../record-provider'; import { useDesignable } from '../../hooks'; import { useIsBlockInPage } from './hooks/useIsBlockInPage'; import { SchemaSettingsSwitchItem } from '../../../schema-settings'; +import { useBlockRequestContext } from '../../../block-provider/BlockProvider'; const FixedBlockContext = React.createContext<{ setFixedBlock: (value: string | false) => void; @@ -73,6 +74,7 @@ export const FixedBlockDesignerItem = () => { const { dn } = useDesignable(); const { inFixedBlock } = useFixedBlock(); const { isBlockInPage } = useIsBlockInPage(); + const { service } = useBlockRequestContext(); if (!isBlockInPage() || !inFixedBlock) { return null; @@ -93,6 +95,7 @@ export const FixedBlockDesignerItem = () => { }, }); field.decoratorProps = fieldSchema['x-decorator-props'] = decoratorProps; + service?.refresh?.(); }} /> );