mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Refresh sidebar when starting new chat, allow more characters in chat title
This commit is contained in:
2 files changed
+19
-10
No files matched your search
@@ -10,6 +10,7 @@ import { useIsMobile } from '@/hooks/useIsMobile';
|
||||
import { useAISettings } from '@/hooks/useAISettings';
|
||||
import { useAppContext } from '@/hooks/useAppContext';
|
||||
import { ChatsManager } from '@/lib/ChatsManager';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { AppLayout } from '@/components/AppLayout';
|
||||
import { OnboardingDialog } from '@/components/OnboardingDialog';
|
||||
import { Act1Dialog } from '@/components/Act1Dialog';
|
||||
@@ -41,6 +42,7 @@ export default function Index() {
|
||||
const [giftCardCode, setGiftCardCode] = useState('');
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const queryClient = useQueryClient();
|
||||
const projectsManager = useProjectsManager();
|
||||
const chatsManager = useChatsManager();
|
||||
const { fs } = useFS();
|
||||
@@ -247,6 +249,9 @@ export default function Index() {
|
||||
// Create chat with initial message
|
||||
await chatsManager.createChat(finalChatId, prompt.trim());
|
||||
|
||||
// Invalidate chats query to update sidebar
|
||||
queryClient.invalidateQueries({ queryKey: ['chats'] });
|
||||
|
||||
// Clear attached files after successful creation
|
||||
setAttachedFiles([]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user