Compare commits
3 Commits
a76cf224f6
...
f0c16a3cd1
| Author | SHA1 | Date | |
|---|---|---|---|
|
f0c16a3cd1
|
|||
|
f54b192616
|
|||
|
b20de667a4
|
@@ -87,7 +87,7 @@ export const newChatStore = (
|
||||
image_gen_api = "https://api.openai.com/v1/images/generations",
|
||||
image_gen_key = "",
|
||||
json_mode = false,
|
||||
logprobs = true
|
||||
logprobs = false
|
||||
): ChatStore => {
|
||||
return {
|
||||
chatgpt_api_web_version: CHATGPT_API_WEB_VERSION,
|
||||
@@ -290,7 +290,7 @@ export function App() {
|
||||
chatStore.image_gen_api,
|
||||
chatStore.image_gen_key,
|
||||
chatStore.json_mode,
|
||||
chatStore.logprobs
|
||||
false // logprobs default to false
|
||||
)
|
||||
);
|
||||
setSelectedChatIndex(newKey as number);
|
||||
|
||||
@@ -56,11 +56,24 @@ export default function ChatBOX(props: {
|
||||
const [showAddToolMsg, setShowAddToolMsg] = useState(false);
|
||||
const [newToolCallID, setNewToolCallID] = useState("");
|
||||
const [newToolContent, setNewToolContent] = useState("");
|
||||
let default_follow = localStorage.getItem("follow");
|
||||
if (default_follow === null) {
|
||||
default_follow = "true";
|
||||
}
|
||||
const [follow, _setFollow] = useState(default_follow === "true");
|
||||
const mediaRef = createRef();
|
||||
|
||||
const setFollow = (follow: boolean) => {
|
||||
console.log("set follow", follow);
|
||||
localStorage.setItem("follow", follow.toString());
|
||||
_setFollow(follow);
|
||||
};
|
||||
|
||||
const messagesEndRef = createRef();
|
||||
useEffect(() => {
|
||||
messagesEndRef.current.scrollIntoView({ behavior: "smooth" });
|
||||
if (follow) {
|
||||
messagesEndRef.current.scrollIntoView({ behavior: "smooth" });
|
||||
}
|
||||
}, [showRetry, showGenerating, generatingMessage]);
|
||||
|
||||
const client = new ChatGPT(chatStore.apiKey);
|
||||
@@ -804,6 +817,18 @@ export default function ChatBOX(props: {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{generatingMessage && (
|
||||
<span
|
||||
class="p-2 m-2 rounded bg-white dark:text-black dark:bg-white dark:bg-opacity-50 dark:text-black dark:bg-opacity-50"
|
||||
style={{ textAlign: "right" }}
|
||||
onClick={() => {
|
||||
setFollow(!follow);
|
||||
}}
|
||||
>
|
||||
<label>Follow</label>
|
||||
<input type="checkbox" checked={follow} />
|
||||
</span>
|
||||
)}
|
||||
<div className="flex justify-between">
|
||||
{(chatStore.model.match("vision") ||
|
||||
(chatStore.image_gen_api && chatStore.image_gen_key)) && (
|
||||
|
||||
Reference in New Issue
Block a user