mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 00:56:26 +08:00
fix(core): improve performance (#6345)
This commit is contained in:
@@ -4,8 +4,9 @@ import { useMemo } from 'react';
|
||||
export function useDocEngineStatus() {
|
||||
const workspace = useService(Workspace);
|
||||
|
||||
const engineState = useLiveData(workspace.engine.docEngineState$);
|
||||
|
||||
const engineState = useLiveData(
|
||||
workspace.engine.docEngineState$.throttleTime(100)
|
||||
);
|
||||
const progress =
|
||||
(engineState.total - engineState.syncing) / engineState.total;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user