diff --git a/client/src/components/Nav/MobileNav.tsx b/client/src/components/Nav/MobileNav.tsx index 8c7650ad27..3edafe8c38 100644 --- a/client/src/components/Nav/MobileNav.tsx +++ b/client/src/components/Nav/MobileNav.tsx @@ -1,37 +1,41 @@ import React from 'react'; import { useRecoilValue } from 'recoil'; -import { useLocalize, useConversation } from '~/hooks'; +import type { Dispatch, SetStateAction } from 'react'; +import { useLocalize, useNewConvo } from '~/hooks'; import store from '~/store'; -export default function MobileNav({ setNavVisible }) { - const conversation = useRecoilValue(store.conversation); - const { newConversation } = useConversation(); - const { title = 'New Chat' } = conversation || {}; +export default function MobileNav({ + setNavVisible, +}: { + setNavVisible: Dispatch>; +}) { const localize = useLocalize(); + const { newConversation } = useNewConvo(0); + const conversation = useRecoilValue(store.conversationByIndex(0)); + const { title = 'New Chat' } = conversation || {}; return ( -
+

@@ -39,19 +43,19 @@ export default function MobileNav({ setNavVisible }) {

diff --git a/client/src/routes/Root.tsx b/client/src/routes/Root.tsx index b9dfd9cdaf..d6619cdd52 100644 --- a/client/src/routes/Root.tsx +++ b/client/src/routes/Root.tsx @@ -72,8 +72,8 @@ export default function Root() { <>