mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(core): maxWait for sync progress debounce (#5377)
This commit is contained in:
@@ -97,9 +97,16 @@ const useSyncEngineSyncProgress = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSyncEngineStatus(currentWorkspace.engine.sync.status);
|
setSyncEngineStatus(currentWorkspace.engine.sync.status);
|
||||||
const disposable = currentWorkspace.engine.sync.onStatusChange.on(
|
const disposable = currentWorkspace.engine.sync.onStatusChange.on(
|
||||||
debounce(status => {
|
debounce(
|
||||||
setSyncEngineStatus(status);
|
status => {
|
||||||
}, 500)
|
setSyncEngineStatus(status);
|
||||||
|
},
|
||||||
|
300,
|
||||||
|
{
|
||||||
|
maxWait: 500,
|
||||||
|
trailing: true,
|
||||||
|
}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
return () => {
|
return () => {
|
||||||
disposable?.dispose();
|
disposable?.dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user