mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-19 00:36:12 +01:00
feat: pull up the cost hooks into chatView to reduce api calls
This commit is contained in:
parent
3b1c07ff46
commit
a820d79bfc
8 changed files with 57 additions and 32 deletions
|
|
@ -51,9 +51,12 @@ function ChatView({ index = 0 }: { index?: number }) {
|
|||
enabled: !!fileMap,
|
||||
});
|
||||
|
||||
const { data: conversationCosts } = useGetConversationCosts(conversationId ?? '', {
|
||||
enabled: !!conversationId && conversationId !== Constants.NEW_CONVO,
|
||||
});
|
||||
const { data: conversationCosts } = useGetConversationCosts(
|
||||
conversationId && conversationId !== Constants.NEW_CONVO ? conversationId : '',
|
||||
{
|
||||
enabled: !!conversationId && conversationId !== Constants.NEW_CONVO && conversationId !== '',
|
||||
},
|
||||
);
|
||||
|
||||
const chatHelpers = useChatHelpers(index, conversationId);
|
||||
const addedChatHelpers = useAddedResponse({ rootIndex: index });
|
||||
|
|
@ -168,6 +171,7 @@ function ChatView({ index = 0 }: { index?: number }) {
|
|||
</div>
|
||||
)
|
||||
}
|
||||
costs={conversationCosts}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue