clean up chatStore
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import { ChatStore } from "@/types/chatstore";
|
||||
import { Tr } from "@/translate";
|
||||
import { useContext } from "react";
|
||||
import { AppContext } from "@/pages/App";
|
||||
|
||||
const VersionHint = (props: { chatStore: ChatStore }) => {
|
||||
const { chatStore } = props;
|
||||
const VersionHint = () => {
|
||||
const ctx = useContext(AppContext);
|
||||
if (!ctx) return <div>error</div>;
|
||||
|
||||
const { chatStore } = ctx;
|
||||
return (
|
||||
<>
|
||||
{chatStore.chatgpt_api_web_version < "v1.3.0" && (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createRef } from "react";
|
||||
import { createRef, useContext } from "react";
|
||||
|
||||
import { ChatStore } from "@/types/chatstore";
|
||||
import { useEffect, useState, Dispatch } from "react";
|
||||
@@ -10,13 +10,17 @@ import {
|
||||
MicIcon,
|
||||
VoicemailIcon,
|
||||
} from "lucide-react";
|
||||
import { AppContext } from "@/pages/App";
|
||||
|
||||
const WhisperButton = (props: {
|
||||
chatStore: ChatStore;
|
||||
inputMsg: string;
|
||||
setInputMsg: Dispatch<string>;
|
||||
}) => {
|
||||
const { chatStore, inputMsg, setInputMsg } = props;
|
||||
const ctx = useContext(AppContext);
|
||||
if (!ctx) return <div>error</div>;
|
||||
const { chatStore } = ctx;
|
||||
|
||||
const { inputMsg, setInputMsg } = props;
|
||||
const mediaRef = createRef();
|
||||
const [isRecording, setIsRecording] = useState("Mic");
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user