From b983095e130435f0c0707f83d144240a56a66516 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 7 Oct 2023 22:47:21 +0800 Subject: [PATCH] Fix About page to Conversation navigation --- frontend/src/Navigation.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 9507cfe1a..aa1367a6e 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from 'react'; -import { NavLink } from 'react-router-dom'; +import { NavLink, useNavigate } from 'react-router-dom'; import Arrow1 from './assets/arrow.svg'; import Arrow2 from './assets/dropdown-arrow.svg'; import Exit from './assets/exit.svg'; @@ -60,6 +60,8 @@ export default function Navigation() { const embeddingsName = import.meta.env.VITE_EMBEDDINGS_NAME || 'openai_text-embedding-ada-002'; + const navigate = useNavigate(); + useEffect(() => { if (!conversations) { getConversations() @@ -111,6 +113,7 @@ export default function Navigation() { }) .then((response) => response.json()) .then((data) => { + navigate('/'); dispatch(setConversation(data)); dispatch( updateConversationId({