diff --git a/packages/jupyter-ai/src/components/chat-messages.tsx b/packages/jupyter-ai/src/components/chat-messages.tsx index ec2e0cf1a..a0e6eb588 100644 --- a/packages/jupyter-ai/src/components/chat-messages.tsx +++ b/packages/jupyter-ai/src/components/chat-messages.tsx @@ -43,11 +43,11 @@ function sortMessages( */ const aOriginTimestamp = - a.type === 'agent' && a.reply_to in timestampsById + "reply_to" in a && a.reply_to in timestampsById ? timestampsById[a.reply_to] : a.time; const bOriginTimestamp = - b.type === 'agent' && b.reply_to in timestampsById + "reply_to" in b && b.reply_to in timestampsById ? timestampsById[b.reply_to] : b.time;