mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
🔀 fix: Address Convo/Preset Switching Issues (#2709)
* fix(schemas): interchangeability between chatGptLabel <> modelLabel * fix: display error message from enforceModelSpecs when conversation already existed * fix(Mention): use activeIndex on mention tab/enter * fix: correctly navigate to new conversation when deleting/archiving a new, active convo
This commit is contained in:
parent
e42709bd1f
commit
94eeec354e
5 changed files with 74 additions and 51 deletions
|
|
@ -1,12 +1,10 @@
|
|||
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '~/components/ui';
|
||||
import { useParams, useNavigate } from 'react-router-dom';
|
||||
import type { MouseEvent, FocusEvent, KeyboardEvent } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
|
||||
import { useArchiveConversationMutation } from '~/data-provider';
|
||||
|
||||
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '~/components/ui';
|
||||
import { useConversations, useLocalize, useNewConvo } from '~/hooks';
|
||||
import { useToastContext } from '~/Providers';
|
||||
import { useArchiveConversationMutation } from '~/data-provider';
|
||||
import { NotificationSeverity } from '~/common';
|
||||
import { useToastContext } from '~/Providers';
|
||||
|
||||
type ArchiveButtonProps = {
|
||||
conversationId: string;
|
||||
|
|
@ -23,8 +21,9 @@ export default function ArchiveButton({
|
|||
className = '',
|
||||
}: ArchiveButtonProps) {
|
||||
const localize = useLocalize();
|
||||
const { newConversation } = useNewConvo();
|
||||
const navigate = useNavigate();
|
||||
const { showToast } = useToastContext();
|
||||
const { newConversation } = useNewConvo();
|
||||
const { refreshConversations } = useConversations();
|
||||
const { conversationId: currentConvoId } = useParams();
|
||||
|
||||
|
|
@ -42,8 +41,9 @@ export default function ArchiveButton({
|
|||
{ conversationId, isArchived: shouldArchive },
|
||||
{
|
||||
onSuccess: () => {
|
||||
if (currentConvoId === conversationId) {
|
||||
if (currentConvoId === conversationId || currentConvoId === 'new') {
|
||||
newConversation();
|
||||
navigate('/c/new', { replace: true });
|
||||
}
|
||||
refreshConversations();
|
||||
retainView();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue