fix: duplicated modal and loading state (#465)
This commit is contained in:
parent
ca09aec249
commit
1d9be70d89
@ -7,7 +7,7 @@ import { useAtomValue } from 'jotai'
|
|||||||
import SecondaryButton from '../SecondaryButton'
|
import SecondaryButton from '../SecondaryButton'
|
||||||
import { PlusIcon } from '@heroicons/react/24/outline'
|
import { PlusIcon } from '@heroicons/react/24/outline'
|
||||||
import useCreateConversation from '@hooks/useCreateConversation'
|
import useCreateConversation from '@hooks/useCreateConversation'
|
||||||
import { activeAssistantModelAtom } from '@helpers/atoms/Model.atom'
|
import { activeAssistantModelAtom, stateModel } from '@helpers/atoms/Model.atom'
|
||||||
import {
|
import {
|
||||||
currentConvoStateAtom,
|
currentConvoStateAtom,
|
||||||
getActiveConvoIdAtom,
|
getActiveConvoIdAtom,
|
||||||
@ -23,6 +23,7 @@ const InputToolbar: React.FC = () => {
|
|||||||
const { inputState, currentConvo } = useGetInputState()
|
const { inputState, currentConvo } = useGetInputState()
|
||||||
const { requestCreateConvo } = useCreateConversation()
|
const { requestCreateConvo } = useCreateConversation()
|
||||||
const { startModel } = useStartStopModel()
|
const { startModel } = useStartStopModel()
|
||||||
|
const { loading } = useAtomValue(stateModel)
|
||||||
const conversations = useAtomValue(userConversationsAtom)
|
const conversations = useAtomValue(userConversationsAtom)
|
||||||
|
|
||||||
const activeConvoId = useAtomValue(getActiveConvoIdAtom)
|
const activeConvoId = useAtomValue(getActiveConvoIdAtom)
|
||||||
@ -44,7 +45,8 @@ const InputToolbar: React.FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (inputState === 'model-mismatch' || inputState === 'loading') {
|
if (inputState === 'model-mismatch' || inputState === 'loading') {
|
||||||
const message = inputState === 'loading' ? 'Loading..' : 'Model mismatch!'
|
const message =
|
||||||
|
inputState === 'loading' || loading ? 'Loading..' : 'Model mismatch!'
|
||||||
return (
|
return (
|
||||||
<div className="sticky bottom-0 flex items-center justify-center bg-background/90">
|
<div className="sticky bottom-0 flex items-center justify-center bg-background/90">
|
||||||
<div className="mb-2">
|
<div className="mb-2">
|
||||||
|
|||||||
@ -22,8 +22,6 @@ export const ModalWrapper: React.FC<Props> = ({ children }) => (
|
|||||||
<BotListModal />
|
<BotListModal />
|
||||||
<SwitchingModelConfirmationModal />
|
<SwitchingModelConfirmationModal />
|
||||||
<ModalNoActiveModel />
|
<ModalNoActiveModel />
|
||||||
<SwitchingModelConfirmationModal />
|
|
||||||
<ModalNoActiveModel />
|
|
||||||
{children}
|
{children}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user