From 2f0abb430c5a783cbc828148c7e109d2b554df51 Mon Sep 17 00:00:00 2001 From: 777genius Date: Sun, 31 May 2026 00:20:34 +0300 Subject: [PATCH] perf(renderer): share unchanged global tasks --- src/renderer/store/slices/teamSlice.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/renderer/store/slices/teamSlice.ts b/src/renderer/store/slices/teamSlice.ts index 2bc9512e..5f9e7b18 100644 --- a/src/renderer/store/slices/teamSlice.ts +++ b/src/renderer/store/slices/teamSlice.ts @@ -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 = (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;