mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
fix: variable dynamic refresh & space match (#2142)
* fix: variable dynamic refresh & space match * fix variable picker filter
This commit is contained in:
@@ -20,6 +20,7 @@ import { textToEditorState } from './utils';
|
||||
import { MaxLengthPlugin } from './plugins/MaxLengthPlugin';
|
||||
import { VariableLabelNode } from './plugins/VariableLabelPlugin/node';
|
||||
import VariableLabelPlugin from './plugins/VariableLabelPlugin';
|
||||
import { useDeepCompareEffect } from 'ahooks';
|
||||
|
||||
export default function Editor({
|
||||
h = 200,
|
||||
@@ -79,10 +80,10 @@ export default function Editor({
|
||||
document.addEventListener('mouseup', handleMouseUp);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
useDeepCompareEffect(() => {
|
||||
if (focus) return;
|
||||
setKey(getNanoid(6));
|
||||
}, [value, variables.length]);
|
||||
}, [value, variables]);
|
||||
|
||||
return (
|
||||
<Box position={'relative'} width={'full'} h={`${height}px`} cursor={'text'}>
|
||||
|
Reference in New Issue
Block a user