feat: Disable automatic saving of agent during running agent #3349 (#3350)

### What problem does this PR solve?

feat: Disable automatic saving of agent during running agent #3349

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-11-12 12:47:36 +08:00
committed by GitHub
parent db23d62827
commit 00b6000b76
8 changed files with 22 additions and 118 deletions

View File

@ -681,7 +681,7 @@ export const useCopyPaste = () => {
}, [onPasteCapture]);
};
export const useWatchAgentChange = () => {
export const useWatchAgentChange = (chatDrawerVisible: boolean) => {
const [time, setTime] = useState<string>();
const nodes = useGraphStore((state) => state.nodes);
const edges = useGraphStore((state) => state.edges);
@ -697,9 +697,11 @@ export const useWatchAgentChange = () => {
}, [flowDetail, setSaveTime]);
const saveAgent = useCallback(async () => {
const ret = await saveGraph();
setSaveTime(ret.data.update_time);
}, [saveGraph, setSaveTime]);
if (!chatDrawerVisible) {
const ret = await saveGraph();
setSaveTime(ret.data.update_time);
}
}, [chatDrawerVisible, saveGraph, setSaveTime]);
useDebounceEffect(
() => {