Fix Save debounce
This commit is contained in:
parent
6af34864ad
commit
4ac1b4f1b0
3 changed files with 4 additions and 4 deletions
|
|
@ -753,4 +753,4 @@ export const NATIVE_CATEGORIES = [
|
|||
"agents",
|
||||
];
|
||||
|
||||
export const SAVE_DEBOUNCE_TIME = 500;
|
||||
export const SAVE_DEBOUNCE_TIME = 300;
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ const useFlowsManagerStore = create<FlowsManagerStoreType>((set, get) => ({
|
|||
},
|
||||
SAVE_DEBOUNCE_TIME
|
||||
),
|
||||
saveFlow: (flow: FlowType, silent?: boolean) => {
|
||||
saveFlow: debounce((flow: FlowType, silent?: boolean) => {
|
||||
set({ saveLoading: true });
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
updateFlowInDatabase(flow)
|
||||
|
|
@ -142,7 +142,7 @@ const useFlowsManagerStore = create<FlowsManagerStoreType>((set, get) => ({
|
|||
reject(err);
|
||||
});
|
||||
});
|
||||
},
|
||||
}, SAVE_DEBOUNCE_TIME),
|
||||
uploadFlows: () => {
|
||||
return new Promise<void>((resolve) => {
|
||||
const input = document.createElement("input");
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export type FlowsManagerStoreType = {
|
|||
isLoading: boolean;
|
||||
setIsLoading: (isLoading: boolean) => void;
|
||||
refreshFlows: () => Promise<void>;
|
||||
saveFlow: (flow: FlowType, silent?: boolean) => Promise<void>;
|
||||
saveFlow: (flow: FlowType, silent?: boolean) => Promise<void> | undefined;
|
||||
autoSaveCurrentFlow: (
|
||||
nodes: Node[],
|
||||
edges: Edge[],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue