perf(renderer): share unchanged global tasks
This commit is contained in:
parent
7f68d9823e
commit
2f0abb430c
1 changed files with 7 additions and 4 deletions
|
|
@ -128,7 +128,10 @@ import {
|
||||||
collectTeamScopedStateRemovals,
|
collectTeamScopedStateRemovals,
|
||||||
collectTeamScopedVisibleLoadingResets,
|
collectTeamScopedVisibleLoadingResets,
|
||||||
} from '../team/teamScopedStateCleanup';
|
} from '../team/teamScopedStateCleanup';
|
||||||
import { structurallyShareTeamSnapshot } from '../team/teamSnapshotStructuralSharing';
|
import {
|
||||||
|
structurallySharePlainValue,
|
||||||
|
structurallyShareTeamSnapshot,
|
||||||
|
} from '../team/teamSnapshotStructuralSharing';
|
||||||
import { parseToolApprovalSettings } from '../team/teamToolApprovalSettings';
|
import { parseToolApprovalSettings } from '../team/teamToolApprovalSettings';
|
||||||
import { noteTeamRefreshFanout } from '../teamRefreshFanoutDiagnostics';
|
import { noteTeamRefreshFanout } from '../teamRefreshFanoutDiagnostics';
|
||||||
import {
|
import {
|
||||||
|
|
@ -1572,12 +1575,12 @@ export const createTeamSlice: StateCreator<AppState, [], [], TeamSlice> = (set,
|
||||||
isInitialFetch: wasFirst,
|
isInitialFetch: wasFirst,
|
||||||
});
|
});
|
||||||
|
|
||||||
set({
|
set((state) => ({
|
||||||
globalTasks: tasks,
|
globalTasks: structurallySharePlainValue(state.globalTasks, tasks),
|
||||||
globalTasksLoading: false,
|
globalTasksLoading: false,
|
||||||
globalTasksInitialized: true,
|
globalTasksInitialized: true,
|
||||||
globalTasksError: null,
|
globalTasksError: null,
|
||||||
});
|
}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (!isContextRequestScopeCurrent(get, requestScope)) {
|
if (!isContextRequestScopeCurrent(get, requestScope)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue