diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx index 3cf9c94..51f0117 100644 --- a/src/components/Layouts/Layout.tsx +++ b/src/components/Layouts/Layout.tsx @@ -4,7 +4,7 @@ import { useLocation, NavLink } from "react-router-dom" import { Sidebar } from "../Option/Sidebar" import { Drawer, Select, Tooltip } from "antd" import { useQuery } from "@tanstack/react-query" -import { getAllModels } from "~/services/ollama" +import { fetchChatModels, getAllModels } from "~/services/ollama" import { useMessageOption } from "~/hooks/useMessageOption" import { ChevronLeft, @@ -46,7 +46,7 @@ export default function OptionLayout({ isFetching: isModelsFetching } = useQuery({ queryKey: ["fetchModel"], - queryFn: () => getAllModels({ returnEmpty: true }), + queryFn: () => fetchChatModels({ returnEmpty: true }), refetchInterval: 15000 }) diff --git a/src/components/Option/Settings/tts-mode.tsx b/src/components/Option/Settings/tts-mode.tsx index 8630ae4..7a316de 100644 --- a/src/components/Option/Settings/tts-mode.tsx +++ b/src/components/Option/Settings/tts-mode.tsx @@ -1,6 +1,7 @@ import { SaveButton } from "@/components/Common/SaveButton" import { getSearchSettings, setSearchSettings } from "@/services/search" import { getTTSSettings, setTTSSettings } from "@/services/tts" +import { useWebUI } from "@/store/webui" import { SUPPORTED_SERACH_PROVIDERS } from "@/utils/search-provider" import { useForm } from "@mantine/form" import { useQuery, useQueryClient } from "@tanstack/react-query" @@ -9,7 +10,7 @@ import { useTranslation } from "react-i18next" export const TTSModeSettings = ({ hideTitle }: { hideTitle?: boolean }) => { const { t } = useTranslation("settings") - const queryClient = useQueryClient() + const { setTTSEnabled } = useWebUI() const form = useForm({ initialValues: { @@ -46,6 +47,7 @@ export const TTSModeSettings = ({ hideTitle }: { hideTitle?: boolean }) => {