diff --git a/src/app.tsx b/src/app.tsx
index 9f23e86..c97ad13 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -205,7 +205,12 @@ export function App() {
DEL
-
+
);
}
diff --git a/src/chatbox.tsx b/src/chatbox.tsx
index 1f1183d..ce77b7e 100644
--- a/src/chatbox.tsx
+++ b/src/chatbox.tsx
@@ -1,5 +1,5 @@
import { createRef } from "preact";
-import { useEffect, useState } from "preact/hooks";
+import { StateUpdater, useEffect, useState } from "preact/hooks";
import type { ChatStore } from "./app";
import ChatGPT, { ChunkMessage, FetchResponse } from "./chatgpt";
import Message from "./message";
@@ -8,6 +8,8 @@ import Settings from "./settings";
export default function ChatBOX(props: {
chatStore: ChatStore;
setChatStore: (cs: ChatStore) => void;
+ selectedChatIndex: number;
+ setSelectedChatIndex: StateUpdater;
}) {
const { chatStore, setChatStore } = props;
// prevent error
@@ -134,6 +136,7 @@ export default function ChatBOX(props: {
alert(error);
} finally {
setShowGenerating(false);
+ props.setSelectedChatIndex(props.selectedChatIndex);
}
};
@@ -205,7 +208,7 @@ export default function ChatBOX(props: {
⚙Endpoint: {chatStore.apiEndpoint}
- ⬆点击上方更改此对话的参数
+ ⬆点击上方更改此对话的参数(请勿泄漏)
↖点击左上角 NEW 新建对话