From 98a70fd5ddbd09f338c3617cf4c5f0c6ca87d82f Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Fri, 10 Jan 2025 13:23:32 +0000 Subject: [PATCH] fix: clear old readOnly data when running resolveData --- packages/core/lib/resolve-component-data.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/core/lib/resolve-component-data.ts b/packages/core/lib/resolve-component-data.ts index ace6dc0239..bb820d4fa5 100644 --- a/packages/core/lib/resolve-component-data.ts +++ b/packages/core/lib/resolve-component-data.ts @@ -47,10 +47,6 @@ export const resolveComponentData = async ( const { props: resolvedProps, readOnly = {} } = await configForItem.resolveData(item, { changed, lastData: oldItem }); - const { readOnly: existingReadOnly = {} } = item || {}; - - const newReadOnly = { ...existingReadOnly, ...readOnly }; - const resolvedItem = { ...item, props: { @@ -59,8 +55,8 @@ export const resolveComponentData = async ( }, }; - if (Object.keys(newReadOnly).length) { - resolvedItem.readOnly = newReadOnly; + if (Object.keys(readOnly).length) { + resolvedItem.readOnly = readOnly; } cache.lastChange[item.props.id] = {