Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
fix(Settings/General): fix clear convos bug where active convo would still appear after clearing convos
Danny Avila8959576d75a4
diff --git a/client/src/components/Nav/Settings.jsx b/client/src/components/Nav/Settings.jsxindex 4fca535530..c396ab97ec 100644--- a/client/src/components/Nav/Settings.jsx+++ b/client/src/components/Nav/Settings.jsx@@ -1,18 +1,14 @@import * as Tabs from '@radix-ui/react-tabs';-import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/Dialog.tsx';-import { General } from './SettingsTabs/';+import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui';+import { General } from './';import { CogIcon } from '~/components/svg';import { useEffect, useState } from 'react';import { cn } from '~/utils/';-import { useClearConversationsMutation } from '@librechat/data-provider';import { useRecoilValue } from 'recoil';-import store from '~/store';import { localize } from '~/localization/Translation';+import store from '~/store';export default function Settings({ open, onOpenChange }) {- const { newConversation } = store.useConversation();- const { refreshConversations } = store.useConversations();- const clearConvosMutation = useClearConversationsMutation();const [confirmClear, setConfirmClear] = useState(false);const [isMobile, setIsMobile] = useState(false);const lang = useRecoilValue(store.lang);@@ -31,13 +27,6 @@ export default function Settings({ open, onOpenChange }) {window.addEventListener('resize', checkMobile);}, []);- useEffect(() => {- if (clearConvosMutation.isSuccess) {- refreshConversations();- newConversation();- }- }, [clearConvosMutation.isSuccess, newConversation, refreshConversations]);-useEffect(() => {// If the user clicks in the dialog when confirmClear is true, set it to falseconst handleClick = (e) => {diff --git a/client/src/components/Nav/SettingsTabs/General.tsx b/client/src/components/Nav/SettingsTabs/General.tsxindex 5620693d7b..13901e9af2 100644--- a/client/src/components/Nav/SettingsTabs/General.tsx+++ b/client/src/components/Nav/SettingsTabs/General.tsx@@ -1,7 +1,7 @@import * as Tabs from '@radix-ui/react-tabs';import { CheckIcon } from 'lucide-react';import { ThemeContext } from '~/hooks/ThemeContext';-import React, { useState, useContext, useCallback } from 'react';+import React, { useState, useContext, useEffect, useCallback } from 'react';import { useClearConversationsMutation } from '@librechat/data-provider';import { useRecoilValue } from 'recoil';import store from '~/store';@@ -70,6 +70,15 @@ function General() {const { theme, setTheme } = useContext(ThemeContext);const clearConvosMutation = useClearConversationsMutation();const [confirmClear, setConfirmClear] = useState(false);+ const { newConversation } = store.useConversation();+ const { refreshConversations } = store.useConversations();++ useEffect(() => {+ if (clearConvosMutation.isSuccess) {+ newConversation();+ refreshConversations();+ }+ }, [clearConvosMutation.isSuccess, newConversation, refreshConversations]);const clearConvos = useCallback(() => {if (confirmClear) {