Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 3bc7533

Browse files
committed
fix: remove conversation
1 parent 4af20f5 commit 3bc7533

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/apis/chatgpt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export async function generateAnswersWithChatgptWebApi(
8383
port.onDisconnect.addListener(() => {
8484
console.debug('port disconnected')
8585
controller.abort()
86-
// deleteConversation()
86+
deleteConversation()
8787
})
8888

8989
const models = await getModels(accessToken).catch(() => {

src/components/ChatCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ function ChatCard(props: ChatCardProps) {
8484

8585
useEffect(() => {
8686
if (props.question && (!prevQuestion || prevQuestion !== props.question) && isReady) {
87-
const newQuestion = new ChatItemData('question', props.question + '\n')
88-
const newAnswer = new ChatItemData('answer', 'Waiting for response...')
87+
const newQuestion = new ChatItemData('question', props.question + '\n', session)
88+
const newAnswer = new ChatItemData('answer', 'Waiting for response...', session)
8989
setChatItemData([...chatItemData, newQuestion, newAnswer])
9090
setIsReady(false)
9191
}
92-
}, [props.question, isReady, prevQuestion, chatItemData])
92+
}, [props.question, isReady, prevQuestion, chatItemData, session])
9393

9494
useEffect(() => {
9595
if (bodyRef.current) {

src/components/FloatingToolbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface FloatingToolbarProps {
2020

2121
function FloatingToolbar(props: FloatingToolbarProps) {
2222
const [selection, setSelection] = useState(props.selection)
23-
const [prompt, setPrompt] = useState(props.prompt || '')
23+
// const [prompt, setPrompt] = useState(props.prompt || '')
2424
const [triggered, setTriggered] = useState(props.triggered)
2525
const [config, setConfig] = useState(defaultConfig)
2626
const [render, setRender] = useState(false)
@@ -121,7 +121,7 @@ function FloatingToolbar(props: FloatingToolbarProps) {
121121
if (props.onPromptGenerated) {
122122
props.onPromptGenerated(generatedPrompt)
123123
}
124-
setPrompt(generatedPrompt)
124+
// setPrompt(generatedPrompt)
125125
setTriggered(true)
126126
}}
127127
>

0 commit comments

Comments
 (0)