Fix array option not updated

This commit is contained in:
the1812 2025-05-24 20:10:16 +08:00
parent 9960908cc7
commit 9b3c3576fc

View File

@ -41,7 +41,13 @@ export const installComponent = async (code: string) => {
const defaultSettings = componentToSettings(component)
lodash.defaultsDeep(
existingComponent.settings.options,
lodash.pickBy(defaultSettings.options, value => !Array.isArray(value)),
lodash.pickBy(defaultSettings.options, (value, key) => {
const isArray = Array.isArray(value)
if (isArray) {
return lodash.get(existingComponent.settings.options, key) === undefined
}
return true
}),
)
return {
metadata: component,