Skip to content

Commit

Permalink
loader error has been resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
FanisNgv committed Sep 13, 2024
1 parent ede20d2 commit cef26cb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/app/(withSidebar)/conversations/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ export default function ConversationPage({
setMessage("");
};

const isPendingRequest = currentConversation &&
currentConversation.length > 0 &&
currentConversation[currentConversation.length - 1].sender === "user" &&
currentConversation[currentConversation.length - 1].text !== null;
const sortedConversation = currentConversation?.sort((a, b) => a.id - b.id);

const isPendingRequest = sortedConversation &&
sortedConversation.length > 0 &&
sortedConversation[sortedConversation.length - 1].sender === "user" &&
sortedConversation[sortedConversation.length - 1].text !== null;

return (
<div className="min-h-full w-full relative overflow-hidden hide-scrollbar">
Expand Down

0 comments on commit cef26cb

Please sign in to comment.