From 9b3c3576fcfda655b975ff3049c8f501b2bfcc34 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sat, 24 May 2025 20:10:16 +0800 Subject: [PATCH] Fix array option not updated --- src/components/user-component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/user-component.ts b/src/components/user-component.ts index 2eeb2a49b..7774ccdc9 100644 --- a/src/components/user-component.ts +++ b/src/components/user-component.ts @@ -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,