Skip to content

Commit acdbabb

Browse files
authored
Merge pull request #228 from Azure-Samples/gk/autogen-nb
Fix chat list entry issue
2 parents b60bca2 + 360f5de commit acdbabb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

ui/typescript/src/components/chat/chat-session-list.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ export function ChatSessionList({ className, setSelectedSession: updateSelectedS
2828

2929
// Set the first session as selected
3030
if (data.length > 0) {
31-
const firstChatSession = data[0];
32-
setSelectedSession(firstChatSession);
33-
await fetchChatMessages(firstChatSession.id);
31+
const mostRecentChatSession = data[0];
32+
setSelectedSession(mostRecentChatSession);
33+
await fetchChatMessages(mostRecentChatSession.id);
34+
setUserInfoAtom((prevUserInfo: UserInfoProps) => ({
35+
...prevUserInfo,
36+
chatId: mostRecentChatSession.id,
37+
}));
3438
}
3539
}
3640
fetchChatSessions().then(r => console.log(r));
@@ -46,7 +50,7 @@ export function ChatSessionList({ className, setSelectedSession: updateSelectedS
4650
}
4751
});
4852
const data = await response.json();
49-
setChatsAtom(data as ChatProps[]);
53+
setChatsAtom(data.reverse() as ChatProps[]);
5054
}
5155

5256
// New handler for Listbox onChange event

ui/typescript/src/layouts/header/header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default function Header({ className }: { className?: string }) {
6666
<SearchButton
6767
variant="transparent"
6868
className="ltr:-ml-[17px] rtl:-mr-[17px] dark:text-white"
69-
/> <span className="opacity-25">Semantic Search, Powered by Azure Cognitive Search</span>
69+
/> <span className="opacity-25">Semantic Search, Powered by Azure AI Search</span>
7070
</div>
7171
<HeaderRightArea />
7272
</div>

0 commit comments

Comments
 (0)