mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-24 15:36:50 +08:00
### What problem does this PR solve? Feat: Add variable assignment node #10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -27,9 +27,12 @@ export function useBuildSwitchOperatorOptions(
|
||||
const { t } = useTranslation();
|
||||
|
||||
const switchOperatorOptions = useMemo(() => {
|
||||
return SwitchOperatorOptions.filter((x) =>
|
||||
subset.some((y) => y === x.value),
|
||||
).map((x) => ({
|
||||
const filteredOptions =
|
||||
subset.length > 0
|
||||
? SwitchOperatorOptions.filter((x) => subset.some((y) => y === x.value))
|
||||
: SwitchOperatorOptions;
|
||||
|
||||
return filteredOptions.map((x) => ({
|
||||
value: x.value,
|
||||
icon: (
|
||||
<LogicalOperatorIcon
|
||||
@ -39,7 +42,7 @@ export function useBuildSwitchOperatorOptions(
|
||||
),
|
||||
label: t(`flow.switchOperatorOptions.${x.label}`),
|
||||
}));
|
||||
}, [t]);
|
||||
}, [subset, t]);
|
||||
|
||||
return switchOperatorOptions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user