diff --git a/web/app/_components/InputToolbar/index.tsx b/web/app/_components/InputToolbar/index.tsx index f904c6267..4c61e3b39 100644 --- a/web/app/_components/InputToolbar/index.tsx +++ b/web/app/_components/InputToolbar/index.tsx @@ -3,7 +3,7 @@ import BasicPromptInput from '../BasicPromptInput' import BasicPromptAccessories from '../BasicPromptAccessories' -import { useAtomValue } from 'jotai' +import { useAtomValue, useSetAtom } from 'jotai' import SecondaryButton from '../SecondaryButton' import { PlusIcon } from '@heroicons/react/24/outline' import useCreateConversation from '@hooks/useCreateConversation' @@ -13,9 +13,9 @@ import { getActiveConvoIdAtom, } from '@helpers/atoms/Conversation.atom' import useGetInputState from '@hooks/useGetInputState' -import { Button } from '../../../uikit/button' import useStartStopModel from '@hooks/useStartStopModel' import { userConversationsAtom } from '@helpers/atoms/Conversation.atom' +import { showingModalNoActiveModel } from '@helpers/atoms/Modal.atom' const InputToolbar: React.FC = () => { const activeModel = useAtomValue(activeAssistantModelAtom) @@ -25,12 +25,14 @@ const InputToolbar: React.FC = () => { const { startModel } = useStartStopModel() const { loading } = useAtomValue(stateModel) const conversations = useAtomValue(userConversationsAtom) - const activeConvoId = useAtomValue(getActiveConvoIdAtom) + const setShowModalNoActiveModel = useSetAtom(showingModalNoActiveModel) const onNewConversationClick = () => { if (activeModel) { requestCreateConvo(activeModel) + } else { + setShowModalNoActiveModel(true) } } @@ -43,19 +45,21 @@ const InputToolbar: React.FC = () => { if (!activeConvoId) { return null } - - if (inputState === 'model-mismatch' || inputState === 'loading') { - const message = - inputState === 'loading' || loading ? 'Loading..' : 'Model mismatch!' + if ( + (activeConvoId && inputState === 'model-mismatch') || + inputState === 'loading' + ) { + // const message = inputState === 'loading' ? 'Loading..' : 'Model mismatch!' return (
-
-

+

+ {/*

{message} -

- +

*/} +
) diff --git a/web/app/_components/ModalNoActiveModel/index.tsx b/web/app/_components/ModalNoActiveModel/index.tsx index c2b843953..4af0a44a9 100644 --- a/web/app/_components/ModalNoActiveModel/index.tsx +++ b/web/app/_components/ModalNoActiveModel/index.tsx @@ -39,7 +39,8 @@ const ModalNoActiveModel: React.FC = () => { >

- There is no active model at the moment ... + You don’t have any actively running models. Please start a + downloaded model in My Models page to use this feature.