mirror of
https://github.com/langgenius/dify.git
synced 2025-09-09 09:11:06 +00:00
fix: type error in list-operator (#22803)
This commit is contained in:
parent
c6d7328e15
commit
371fe7a700
@ -184,11 +184,10 @@ class ListOperatorNode(BaseNode):
|
|||||||
value = int(self.graph_runtime_state.variable_pool.convert_template(self._node_data.extract_by.serial).text)
|
value = int(self.graph_runtime_state.variable_pool.convert_template(self._node_data.extract_by.serial).text)
|
||||||
if value < 1:
|
if value < 1:
|
||||||
raise ValueError(f"Invalid serial index: must be >= 1, got {value}")
|
raise ValueError(f"Invalid serial index: must be >= 1, got {value}")
|
||||||
|
if value > len(variable.value):
|
||||||
|
raise InvalidKeyError(f"Invalid serial index: must be <= {len(variable.value)}, got {value}")
|
||||||
value -= 1
|
value -= 1
|
||||||
if len(variable.value) > int(value):
|
result = variable.value[value]
|
||||||
result = variable.value[value]
|
|
||||||
else:
|
|
||||||
result = ""
|
|
||||||
return variable.model_copy(update={"value": [result]})
|
return variable.model_copy(update={"value": [result]})
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ const OptionListItem: FC<OptionListItemProps> = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isSelected && !noAutoScroll)
|
if (isSelected && !noAutoScroll)
|
||||||
listItemRef.current?.scrollIntoView({ behavior: 'instant' })
|
listItemRef.current?.scrollIntoView({ behavior: 'instant' })
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -52,7 +52,6 @@ const TimePicker = ({
|
|||||||
else {
|
else {
|
||||||
setSelectedTime(prev => prev ? getDateWithTimezone({ date: prev, timezone }) : undefined)
|
setSelectedTime(prev => prev ? getDateWithTimezone({ date: prev, timezone }) : undefined)
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [timezone])
|
}, [timezone])
|
||||||
|
|
||||||
const handleClickTrigger = (e: React.MouseEvent) => {
|
const handleClickTrigger = (e: React.MouseEvent) => {
|
||||||
|
@ -117,7 +117,6 @@ const PluginPage = ({
|
|||||||
showInstallFromMarketplace()
|
showInstallFromMarketplace()
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [packageId, bundleInfo])
|
}, [packageId, bundleInfo])
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
@ -519,7 +519,6 @@ export const usePluginTaskList = (category?: PluginType) => {
|
|||||||
refreshPluginList(category ? { category } as any : undefined, !category)
|
refreshPluginList(category ? { category } as any : undefined, !category)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [isRefetching])
|
}, [isRefetching])
|
||||||
|
|
||||||
const handleRefetch = useCallback(() => {
|
const handleRefetch = useCallback(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user