ignore ctx is null early return

This commit is contained in:
2025-01-07 23:52:48 +08:00
parent 001eca79f6
commit 20a152b899
14 changed files with 3 additions and 25 deletions

View File

@@ -45,7 +45,6 @@ import { ImageGenDrawer } from "@/components/ImageGenDrawer";
export default function ChatBOX() {
const ctx = useContext(AppContext);
if (ctx === null) return <></>;
const {
db,
chatStore,
@@ -54,7 +53,6 @@ export default function ChatBOX() {
setSelectedChatIndex,
} = ctx;
// prevent error
if (chatStore === undefined) return <div></div>;
const [inputMsg, setInputMsg] = useState("");
const [images, setImages] = useState<MessageDetail[]>([]);
const [showAddImage, setShowAddImage] = useState(false);