mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
🔀 fix: Correct Expected Behavior for Modular Chat Feature (#1871)
This commit is contained in:
parent
5445d55af2
commit
f431c8fb00
1 changed files with 12 additions and 10 deletions
|
|
@ -65,16 +65,18 @@ const MenuItem: FC<MenuItemProps> = ({
|
||||||
getEndpointField(endpointsConfig, currentEndpoint, 'type') ?? currentEndpoint;
|
getEndpointField(endpointsConfig, currentEndpoint, 'type') ?? currentEndpoint;
|
||||||
const newEndpointType = getEndpointField(endpointsConfig, newEndpoint, 'type') ?? newEndpoint;
|
const newEndpointType = getEndpointField(endpointsConfig, newEndpoint, 'type') ?? newEndpoint;
|
||||||
|
|
||||||
if (
|
const hasEndpoint = modularEndpoints.has(currentEndpoint ?? '');
|
||||||
isExistingConversation &&
|
const hasCurrentEndpointType = modularEndpoints.has(currentEndpointType ?? '');
|
||||||
(modularEndpoints.has(endpoint ?? '') ||
|
const isCurrentModular = hasEndpoint || hasCurrentEndpointType || isAssistantSwitch;
|
||||||
modularEndpoints.has(currentEndpointType ?? '') ||
|
|
||||||
isAssistantSwitch) &&
|
const hasNewEndpoint = modularEndpoints.has(newEndpoint ?? '');
|
||||||
(modularEndpoints.has(newEndpoint ?? '') ||
|
const hasNewEndpointType = modularEndpoints.has(newEndpointType ?? '');
|
||||||
modularEndpoints.has(newEndpointType ?? '') ||
|
const isNewModular = hasNewEndpoint || hasNewEndpointType || isAssistantSwitch;
|
||||||
isAssistantSwitch) &&
|
|
||||||
(endpoint === newEndpoint || modularChat || isAssistantSwitch)
|
const endpointsMatch = currentEndpoint === newEndpoint;
|
||||||
) {
|
const shouldSwitch = endpointsMatch || modularChat || isAssistantSwitch;
|
||||||
|
|
||||||
|
if (isExistingConversation && isCurrentModular && isNewModular && shouldSwitch) {
|
||||||
template.endpointType = newEndpointType;
|
template.endpointType = newEndpointType;
|
||||||
|
|
||||||
const currentConvo = getDefaultConversation({
|
const currentConvo = getDefaultConversation({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue