Fix remote widget undefined arg (#2551)

This commit is contained in:
bymyself
2025-02-14 07:47:18 -07:00
committed by GitHub
parent f9c2db5908
commit 530ca75dd0
3 changed files with 49 additions and 3 deletions

View File

@@ -47,9 +47,11 @@ export const useWidgetStore = defineStore('widget', () => {
if (Array.isArray(inputData[0]))
return getDefaultValue(transformComboInput(inputData))
const widgetType = getWidgetType(inputData[0], inputData[1].name)
const widgetType = getWidgetType(inputData[0], inputData[1]?.name)
const [_, props] = inputData
if (!props) return undefined
if (props.default) return props.default
if (widgetType === 'COMBO' && props.options?.length) return props.options[0]
@@ -63,7 +65,7 @@ export const useWidgetStore = defineStore('widget', () => {
'COMBO',
{
options: inputData[0],
...Object(inputData[1])
...Object(inputData[1] || {})
}
]
: inputData