Skip to content

Commit f402dc8

Browse files
committed
perf(clients): child question indicators ignore unrelated shell updates
1 parent 662bbce commit f402dc8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎packages/client-runtime/src/state/threadShell.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,15 @@ export function createEnvironmentThreadShellAtoms(input: {
169169
}
170170
}
171171
}
172-
if (arrayElementsEqual(previous, next)) return previous;
172+
// Indicators read only ids and titles, so other shell updates keep the old array.
173+
if (
174+
previous.length === next.length &&
175+
previous.every(
176+
(thread, index) => thread.id === next[index]?.id && thread.title === next[index]?.title,
177+
)
178+
) {
179+
return previous;
180+
}
173181
previous = next;
174182
return next;
175183
}).pipe(Atom.withLabel(`environment-child-thread-inputs:${key}`));

0 commit comments

Comments
 (0)