mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
📢 fix: Invalid engineTTS and Conversation State on Navigation (#6904)
* fix: handle invalid engineTTS values and prevent VoiceDropdown render errors * refactor: add verbose developer logging for debugging conversation state issues * refactor: remove unnecessary effect for conversationId changes * chore: imports * fix: include model and entity IDs in conversation query selection * feat: add fetchFreshData function to retrieve conversation data on navigation * fix: remove unnecessary comment in fetchFreshData function * chore: reorder imports in useNavigateToConvo for consistency --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
d32f34e5d7
commit
000f3a3733
11 changed files with 75 additions and 18 deletions
|
|
@ -11,7 +11,7 @@ import {
|
|||
} from 'librechat-data-provider';
|
||||
import type { TPreset, TEndpointsConfig, TStartupConfig } from 'librechat-data-provider';
|
||||
import type { ZodAny } from 'zod';
|
||||
import { getConvoSwitchLogic, getModelSpecIconURL, removeUnavailableTools } from '~/utils';
|
||||
import { getConvoSwitchLogic, getModelSpecIconURL, removeUnavailableTools, logger } from '~/utils';
|
||||
import useDefaultConvo from '~/hooks/Conversations/useDefaultConvo';
|
||||
import { useChatContext, useChatFormContext } from '~/Providers';
|
||||
import useSubmitMessage from '~/hooks/Messages/useSubmitMessage';
|
||||
|
|
@ -159,6 +159,7 @@ export default function useQueryParams({
|
|||
});
|
||||
|
||||
/* We don't reset the latest message, only when changing settings mid-converstion */
|
||||
logger.log('conversation', 'Switching conversation from query params', currentConvo);
|
||||
newConversation({
|
||||
template: currentConvo,
|
||||
preset: newPreset,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import type {
|
|||
TEndpointsConfig,
|
||||
} from 'librechat-data-provider';
|
||||
import type { MentionOption, ConvoGenerator } from '~/common';
|
||||
import { getConvoSwitchLogic, getModelSpecIconURL, removeUnavailableTools } from '~/utils';
|
||||
import { getConvoSwitchLogic, getModelSpecIconURL, removeUnavailableTools, logger } from '~/utils';
|
||||
import { useChatContext } from '~/Providers';
|
||||
import { useDefaultConvo } from '~/hooks';
|
||||
import store from '~/store';
|
||||
|
|
@ -86,6 +86,7 @@ export default function useSelectMention({
|
|||
});
|
||||
|
||||
/* We don't reset the latest message, only when changing settings mid-converstion */
|
||||
logger.info('conversation', 'Switching conversation to new spec (modular)', conversation);
|
||||
newConversation({
|
||||
template: currentConvo,
|
||||
preset,
|
||||
|
|
@ -95,6 +96,7 @@ export default function useSelectMention({
|
|||
return;
|
||||
}
|
||||
|
||||
logger.info('conversation', 'Switching conversation to new spec', conversation);
|
||||
newConversation({
|
||||
template: { ...(template as Partial<TConversation>) },
|
||||
preset,
|
||||
|
|
@ -172,6 +174,11 @@ export default function useSelectMention({
|
|||
});
|
||||
|
||||
/* We don't reset the latest message, only when changing settings mid-converstion */
|
||||
logger.info(
|
||||
'conversation',
|
||||
'Switching conversation to new endpoint/model (modular)',
|
||||
currentConvo,
|
||||
);
|
||||
newConversation({
|
||||
template: currentConvo,
|
||||
preset: currentConvo,
|
||||
|
|
@ -181,6 +188,7 @@ export default function useSelectMention({
|
|||
return;
|
||||
}
|
||||
|
||||
logger.info('conversation', 'Switching conversation to new endpoint/model', template);
|
||||
newConversation({
|
||||
template: { ...(template as Partial<TConversation>) },
|
||||
preset: { ...kwargs, spec: null, iconURL: null, modelLabel: null, endpoint: newEndpoint },
|
||||
|
|
@ -230,6 +238,7 @@ export default function useSelectMention({
|
|||
});
|
||||
|
||||
/* We don't reset the latest message, only when changing settings mid-converstion */
|
||||
logger.info('conversation', 'Switching conversation to new preset (modular)', currentConvo);
|
||||
newConversation({
|
||||
template: currentConvo,
|
||||
preset: newPreset,
|
||||
|
|
@ -239,6 +248,7 @@ export default function useSelectMention({
|
|||
return;
|
||||
}
|
||||
|
||||
logger.info('conversation', 'Switching conversation to new preset', template);
|
||||
newConversation({ preset: newPreset, keepAddedConvos: isModular });
|
||||
},
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue