mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-18 19:46:44 +08:00
Feat: Fixed the issue where the prompt always displayed the initial value when switching between different generate operators #4764 (#4808)
### What problem does this PR solve? Feat: Fixed the issue where the prompt always displayed the initial value when switching between different generate operators #4764 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -33,6 +33,7 @@ import { FlowFormContext } from '@/pages/flow/context';
|
||||
import { useBuildComponentIdSelectOptions } from '@/pages/flow/hooks/use-get-begin-query';
|
||||
import { $createVariableNode } from './variable-node';
|
||||
|
||||
import { ProgrammaticTag } from './constant';
|
||||
import './index.css';
|
||||
class VariableInnerOption extends MenuOption {
|
||||
label: string;
|
||||
@ -215,9 +216,12 @@ export default function VariablePickerMenuPlugin({
|
||||
useEffect(() => {
|
||||
if (editor && value && isFirstRender.current) {
|
||||
isFirstRender.current = false;
|
||||
editor.update(() => {
|
||||
parseTextToVariableNodes(value);
|
||||
});
|
||||
editor.update(
|
||||
() => {
|
||||
parseTextToVariableNodes(value);
|
||||
},
|
||||
{ tag: ProgrammaticTag },
|
||||
);
|
||||
}
|
||||
}, [parseTextToVariableNodes, editor, value]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user