Fix updates being skipped due to erroneous use of 'skip update' flags

This commit is contained in:
Andrew Kingston 2023-12-07 10:47:45 +00:00
parent bc5563d776
commit 710397c46b
1 changed files with 6 additions and 3 deletions

View File

@ -112,7 +112,7 @@ export const getFrontendStore = () => {
}
let clone = cloneDeep(screen)
const result = patchFn(clone)
// An explicit false result means skip this change
if (result === false) {
return
}
@ -879,11 +879,14 @@ export const getFrontendStore = () => {
}
// Mutates the fetched component with updates
const updated = patchFn(component, screen)
const patchResult = patchFn(component, screen)
// Mutates the component with any required settings updates
const migrated = store.actions.components.migrateSettings(component)
return updated || migrated
// Returning an explicit false signifies that we should skip this
// update. If we migrated something, ensure we never skip.
return migrated ? null : patchResult
}
await store.actions.screens.patch(patchScreen, screenId)
},