Skip to content

Commit

Permalink
Fix chat list entry issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thegovind committed May 27, 2024
1 parent 5b2515d commit 360f5de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions ui/typescript/src/components/chat/chat-session-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ export function ChatSessionList({ className, setSelectedSession: updateSelectedS

// Set the first session as selected
if (data.length > 0) {
const firstChatSession = data[0];
setSelectedSession(firstChatSession);
await fetchChatMessages(firstChatSession.id);
const mostRecentChatSession = data[0];
setSelectedSession(mostRecentChatSession);
await fetchChatMessages(mostRecentChatSession.id);
setUserInfoAtom((prevUserInfo: UserInfoProps) => ({
...prevUserInfo,
chatId: mostRecentChatSession.id,
}));
}
}
fetchChatSessions().then(r => console.log(r));
Expand All @@ -46,7 +50,7 @@ export function ChatSessionList({ className, setSelectedSession: updateSelectedS
}
});
const data = await response.json();
setChatsAtom(data as ChatProps[]);
setChatsAtom(data.reverse() as ChatProps[]);
}

// New handler for Listbox onChange event
Expand Down
2 changes: 1 addition & 1 deletion ui/typescript/src/layouts/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function Header({ className }: { className?: string }) {
<SearchButton
variant="transparent"
className="ltr:-ml-[17px] rtl:-mr-[17px] dark:text-white"
/> <span className="opacity-25">Semantic Search, Powered by Azure Cognitive Search</span>
/> <span className="opacity-25">Semantic Search, Powered by Azure AI Search</span>
</div>
<HeaderRightArea />
</div>
Expand Down

0 comments on commit 360f5de

Please sign in to comment.