fix: #963 config not work

This commit is contained in:
Yidadaa
2023-04-22 00:12:07 +08:00
parent ab826363ea
commit ae479f4a92
16 changed files with 190 additions and 194 deletions

View File

@@ -9,7 +9,6 @@ import styles from "./home.module.scss";
import BotIcon from "../icons/bot.svg";
import LoadingIcon from "../icons/three-dots.svg";
import { useChatStore } from "../store";
import { getCSSVar, useMobileScreen } from "../utils";
import { Chat } from "./chat";
@@ -24,6 +23,7 @@ import {
useLocation,
} from "react-router-dom";
import { SideBar } from "./sidebar";
import { useAppConfig } from "../store/config";
export function Loading(props: { noLogo?: boolean }) {
return (
@@ -39,7 +39,7 @@ const Settings = dynamic(async () => (await import("./settings")).Settings, {
});
export function useSwitchTheme() {
const config = useChatStore((state) => state.config);
const config = useAppConfig();
useEffect(() => {
document.body.classList.remove("light");
@@ -80,7 +80,7 @@ const useHasHydrated = () => {
};
function WideScreen() {
const config = useChatStore((state) => state.config);
const config = useAppConfig();
return (
<div