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