From f11ea7570a3a4f808e48742e6cb11b4f9e04d37e Mon Sep 17 00:00:00 2001 From: EYHN Date: Fri, 22 Dec 2023 03:28:24 +0000 Subject: [PATCH] fix(core): maxWait for sync progress debounce (#5377) --- .../workspace-slider-bar/workspace-card/index.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/index.tsx b/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/index.tsx index 1fef59aa3ccf6..ddaa00e087325 100644 --- a/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/index.tsx +++ b/packages/frontend/core/src/components/pure/workspace-slider-bar/workspace-card/index.tsx @@ -97,9 +97,16 @@ const useSyncEngineSyncProgress = () => { useEffect(() => { setSyncEngineStatus(currentWorkspace.engine.sync.status); const disposable = currentWorkspace.engine.sync.onStatusChange.on( - debounce(status => { - setSyncEngineStatus(status); - }, 500) + debounce( + status => { + setSyncEngineStatus(status); + }, + 300, + { + maxWait: 500, + trailing: true, + } + ) ); return () => { disposable?.dispose();