From 08a6c17f96847b63c30258b28fa3fde23b29c348 Mon Sep 17 00:00:00 2001 From: michaelchia Date: Tue, 10 Sep 2024 02:07:47 +0800 Subject: [PATCH] Fix sort messages (#975) * fix sort messages * prettier --- packages/jupyter-ai/src/components/chat-messages.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jupyter-ai/src/components/chat-messages.tsx b/packages/jupyter-ai/src/components/chat-messages.tsx index c3fc0921a..aaae93a18 100644 --- a/packages/jupyter-ai/src/components/chat-messages.tsx +++ b/packages/jupyter-ai/src/components/chat-messages.tsx @@ -49,11 +49,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;