refactor: seperate AppContext and AppChatStoreContext
This commit is contained in:
@@ -39,19 +39,14 @@ import {
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
|
||||
import { AppContext } from "./App";
|
||||
import { AppChatStoreContext, AppContext } from "./App";
|
||||
import APIListMenu from "@/components/ListAPI";
|
||||
import { ImageGenDrawer } from "@/components/ImageGenDrawer";
|
||||
|
||||
export default function ChatBOX() {
|
||||
const ctx = useContext(AppContext);
|
||||
const {
|
||||
db,
|
||||
chatStore,
|
||||
setChatStore,
|
||||
selectedChatIndex,
|
||||
setSelectedChatIndex,
|
||||
} = ctx;
|
||||
const { db, selectedChatIndex, setSelectedChatIndex } =
|
||||
useContext(AppContext);
|
||||
const { chatStore, setChatStore } = useContext(AppChatStoreContext);
|
||||
// prevent error
|
||||
const [inputMsg, setInputMsg] = useState("");
|
||||
const [images, setImages] = useState<MessageDetail[]>([]);
|
||||
|
||||
Reference in New Issue
Block a user