perf(web): pause hidden live polling

This commit is contained in:
lingniu
2026-07-16 08:35:37 +08:00
parent e06778e38c
commit 4c54cfa6ff
9 changed files with 46 additions and 15 deletions

View File

@@ -28,6 +28,10 @@ test('rapid viewport changes retain one workspace payload and avoid duplicate fl
});
await waitFor(() => expect(monitorWorkspace).toHaveBeenCalledTimes(1));
const workspaceQuery = client.getQueryCache().findAll({ queryKey: ['monitor', 'workspace'] })[0];
const liveOptions = workspaceQuery?.options as { refetchIntervalInBackground?: boolean; refetchOnWindowFocus?: boolean };
expect(liveOptions.refetchIntervalInBackground).toBe(false);
expect(liveOptions.refetchOnWindowFocus).toBe(true);
expect(monitorSummary).not.toHaveBeenCalled();
expect(vehicleRealtime).not.toHaveBeenCalled();
for (let index = 1; index <= 8; index += 1) {