mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Set key for chatMessage parent to get UX efficiently updated by react
By fixing the no key prop in ChatHistory error on web app
This commit is contained in:
@@ -28,10 +28,6 @@ interface ChatResponse {
|
||||
response: ChatHistoryData;
|
||||
}
|
||||
|
||||
interface ChatHistory {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
interface ChatHistoryProps {
|
||||
conversationId: string;
|
||||
setTitle: (title: string) => void;
|
||||
@@ -368,7 +364,7 @@ export default function ChatHistory(props: ChatHistoryProps) {
|
||||
{data &&
|
||||
data.chat &&
|
||||
data.chat.map((chatMessage, index) => (
|
||||
<>
|
||||
<React.Fragment key={`chatMessage-${index}`}>
|
||||
{chatMessage.trainOfThought && chatMessage.by === "khoj" && (
|
||||
<TrainOfThoughtComponent
|
||||
trainOfThought={chatMessage.trainOfThought?.map(
|
||||
@@ -403,7 +399,7 @@ export default function ChatHistory(props: ChatHistoryProps) {
|
||||
onDeleteMessage={handleDeleteMessage}
|
||||
conversationId={props.conversationId}
|
||||
/>
|
||||
</>
|
||||
</React.Fragment>
|
||||
))}
|
||||
{props.incomingMessages &&
|
||||
props.incomingMessages.map((message, index) => {
|
||||
|
||||
Reference in New Issue
Block a user