mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 13:22: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;
|
response: ChatHistoryData;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ChatHistory {
|
|
||||||
[key: string]: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ChatHistoryProps {
|
interface ChatHistoryProps {
|
||||||
conversationId: string;
|
conversationId: string;
|
||||||
setTitle: (title: string) => void;
|
setTitle: (title: string) => void;
|
||||||
@@ -368,7 +364,7 @@ export default function ChatHistory(props: ChatHistoryProps) {
|
|||||||
{data &&
|
{data &&
|
||||||
data.chat &&
|
data.chat &&
|
||||||
data.chat.map((chatMessage, index) => (
|
data.chat.map((chatMessage, index) => (
|
||||||
<>
|
<React.Fragment key={`chatMessage-${index}`}>
|
||||||
{chatMessage.trainOfThought && chatMessage.by === "khoj" && (
|
{chatMessage.trainOfThought && chatMessage.by === "khoj" && (
|
||||||
<TrainOfThoughtComponent
|
<TrainOfThoughtComponent
|
||||||
trainOfThought={chatMessage.trainOfThought?.map(
|
trainOfThought={chatMessage.trainOfThought?.map(
|
||||||
@@ -403,7 +399,7 @@ export default function ChatHistory(props: ChatHistoryProps) {
|
|||||||
onDeleteMessage={handleDeleteMessage}
|
onDeleteMessage={handleDeleteMessage}
|
||||||
conversationId={props.conversationId}
|
conversationId={props.conversationId}
|
||||||
/>
|
/>
|
||||||
</>
|
</React.Fragment>
|
||||||
))}
|
))}
|
||||||
{props.incomingMessages &&
|
{props.incomingMessages &&
|
||||||
props.incomingMessages.map((message, index) => {
|
props.incomingMessages.map((message, index) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user