diff --git a/web/src/controllers/ReasoningController/ReasoningMessages/ReasoningMessage_Files/ReasoningMessage_Files.tsx b/web/src/controllers/ReasoningController/ReasoningMessages/ReasoningMessage_Files/ReasoningMessage_Files.tsx index a757294ad..ff8f6f4ca 100644 --- a/web/src/controllers/ReasoningController/ReasoningMessages/ReasoningMessage_Files/ReasoningMessage_Files.tsx +++ b/web/src/controllers/ReasoningController/ReasoningMessages/ReasoningMessage_Files/ReasoningMessage_Files.tsx @@ -7,10 +7,30 @@ import { useMessageIndividual } from '@/context/Chats'; export const ReasoningMessage_Files: React.FC = React.memo( ({ isCompletedStream, chatId, reasoningMessageId, messageId }) => { - const { status, id, type, title, secondary_title, file_ids } = useMessageIndividual( + const status = useMessageIndividual( messageId, - (x) => x?.reasoning_messages[reasoningMessageId] - ) as BusterChatMessageReasoning_files; + (x) => (x?.reasoning_messages[reasoningMessageId] as BusterChatMessageReasoning_files)?.status + ); + + const file_ids = useMessageIndividual( + messageId, + (x) => + (x?.reasoning_messages[reasoningMessageId] as BusterChatMessageReasoning_files)?.file_ids + ); + + const title = useMessageIndividual( + messageId, + (x) => (x?.reasoning_messages[reasoningMessageId] as BusterChatMessageReasoning_files)?.title + ); + + const secondary_title = useMessageIndividual( + messageId, + (x) => + (x?.reasoning_messages[reasoningMessageId] as BusterChatMessageReasoning_files) + ?.secondary_title + ); + + if (!title) return null; return (