mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
Fix bug - when clicking on title in search results, was not switching to conversation
This commit is contained in:
parent
e0f9e92bfc
commit
c983670b9e
1 changed files with 5 additions and 6 deletions
|
|
@ -8,7 +8,7 @@ import HoverButtons from './HoverButtons';
|
|||
import SiblingSwitch from './SiblingSwitch';
|
||||
import getIcon from '~/utils/getIcon';
|
||||
import { useMessageHandler } from '~/utils/handleSubmit';
|
||||
import { getConversationById } from '~/data-provider';
|
||||
import { useGetConversationByIdQuery } from '~/data-provider';
|
||||
import { cn } from '~/utils/';
|
||||
import store from '~/store';
|
||||
|
||||
|
|
@ -32,6 +32,7 @@ export default function Message({
|
|||
const { ask, regenerate } = useMessageHandler();
|
||||
const { switchToConversation } = store.useConversation();
|
||||
const blinker = submitting && isSubmitting;
|
||||
const getConversationQuery = useGetConversationByIdQuery(message.conversationId, { enabled: false });
|
||||
|
||||
useEffect(() => {
|
||||
if (blinker && !abortScroll) {
|
||||
|
|
@ -97,11 +98,9 @@ export default function Message({
|
|||
|
||||
const clickSearchResult = async () => {
|
||||
if (!searchResult) return;
|
||||
//we don't need react-query for this so we call the data service directly
|
||||
const convoResponse = await getConversationById(message.conversationId);
|
||||
const convo = convoResponse.data;
|
||||
|
||||
switchToConversation(convo);
|
||||
getConversationQuery.refetch(message.conversationId).then((response) => {
|
||||
switchToConversation(response.data);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue