perf(renderer): share unchanged global tasks

This commit is contained in:
777genius 2026-05-31 00:20:34 +03:00
parent 7f68d9823e
commit 2f0abb430c

View file

@ -128,7 +128,10 @@ import {
collectTeamScopedStateRemovals,
collectTeamScopedVisibleLoadingResets,
} from '../team/teamScopedStateCleanup';
import { structurallyShareTeamSnapshot } from '../team/teamSnapshotStructuralSharing';
import {
structurallySharePlainValue,
structurallyShareTeamSnapshot,
} from '../team/teamSnapshotStructuralSharing';
import { parseToolApprovalSettings } from '../team/teamToolApprovalSettings';
import { noteTeamRefreshFanout } from '../teamRefreshFanoutDiagnostics';
import {
@ -1572,12 +1575,12 @@ export const createTeamSlice: StateCreator<AppState, [], [], TeamSlice> = (set,
isInitialFetch: wasFirst,
});
set({
globalTasks: tasks,
set((state) => ({
globalTasks: structurallySharePlainValue(state.globalTasks, tasks),
globalTasksLoading: false,
globalTasksInitialized: true,
globalTasksError: null,
});
}));
} catch (error) {
if (!isContextRequestScopeCurrent(get, requestScope)) {
continue;