fix(sessions): centralize global polling
This commit is contained in:
@@ -543,22 +543,6 @@ const SessionSidebarComponent: React.FC<SessionSidebarProps> = ({
|
||||
const isWorktreeTopologyLoading = !isVSCode && resolvedWorktreeTopologyKey !== projectWorktreeDiscoveryKey;
|
||||
const [unresolvedWorktreeProjectPaths, setUnresolvedWorktreeProjectPaths] = React.useState<ReadonlySet<string>>(new Set());
|
||||
|
||||
const initialGlobalSessionsRefreshStartedRef = React.useRef(false);
|
||||
React.useEffect(() => {
|
||||
if (initialGlobalSessionsRefreshStartedRef.current) {
|
||||
return;
|
||||
}
|
||||
initialGlobalSessionsRefreshStartedRef.current = true;
|
||||
void refreshGlobalSessions(syncSessionsSnapshotRef.current);
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
const interval = window.setInterval(() => {
|
||||
void refreshGlobalSessions();
|
||||
}, 45_000);
|
||||
return () => window.clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
let cancelled = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user