Skip to content

Commit

Permalink
fix: clear old readOnly data when running resolveData
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Jan 10, 2025
1 parent f6ab512 commit 3e91adc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/core/lib/resolve-component-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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] = {
Expand Down

0 comments on commit 3e91adc

Please sign in to comment.