Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): maxWait for sync progress debounce (#5377)

EYHNf11ea7570a3a
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 1fef59aa3c..ddaa00e087 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();