parent
1d46bee0f9
commit
a5e366c03d
1 changed files with 5 additions and 5 deletions
|
|
@ -8,11 +8,11 @@ const useAutoSaveFlow = () => {
|
||||||
const saveFlow = useSaveFlow();
|
const saveFlow = useSaveFlow();
|
||||||
const autoSaving = useFlowsManagerStore((state) => state.autoSaving);
|
const autoSaving = useFlowsManagerStore((state) => state.autoSaving);
|
||||||
|
|
||||||
const autoSaveFlow = autoSaving
|
const autoSaveFlow = useDebounce((flow?: FlowType) => {
|
||||||
? useDebounce((flow?: FlowType) => {
|
if (autoSaving) {
|
||||||
saveFlow(flow);
|
saveFlow(flow);
|
||||||
}, SAVE_DEBOUNCE_TIME)
|
}
|
||||||
: () => {};
|
}, SAVE_DEBOUNCE_TIME);
|
||||||
|
|
||||||
return autoSaveFlow;
|
return autoSaveFlow;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue