mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +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 SiblingSwitch from './SiblingSwitch';
|
||||||
import getIcon from '~/utils/getIcon';
|
import getIcon from '~/utils/getIcon';
|
||||||
import { useMessageHandler } from '~/utils/handleSubmit';
|
import { useMessageHandler } from '~/utils/handleSubmit';
|
||||||
import { getConversationById } from '~/data-provider';
|
import { useGetConversationByIdQuery } from '~/data-provider';
|
||||||
import { cn } from '~/utils/';
|
import { cn } from '~/utils/';
|
||||||
import store from '~/store';
|
import store from '~/store';
|
||||||
|
|
||||||
|
|
@ -32,6 +32,7 @@ export default function Message({
|
||||||
const { ask, regenerate } = useMessageHandler();
|
const { ask, regenerate } = useMessageHandler();
|
||||||
const { switchToConversation } = store.useConversation();
|
const { switchToConversation } = store.useConversation();
|
||||||
const blinker = submitting && isSubmitting;
|
const blinker = submitting && isSubmitting;
|
||||||
|
const getConversationQuery = useGetConversationByIdQuery(message.conversationId, { enabled: false });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (blinker && !abortScroll) {
|
if (blinker && !abortScroll) {
|
||||||
|
|
@ -97,11 +98,9 @@ export default function Message({
|
||||||
|
|
||||||
const clickSearchResult = async () => {
|
const clickSearchResult = async () => {
|
||||||
if (!searchResult) return;
|
if (!searchResult) return;
|
||||||
//we don't need react-query for this so we call the data service directly
|
getConversationQuery.refetch(message.conversationId).then((response) => {
|
||||||
const convoResponse = await getConversationById(message.conversationId);
|
switchToConversation(response.data);
|
||||||
const convo = convoResponse.data;
|
});
|
||||||
|
|
||||||
switchToConversation(convo);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue