mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-05 00:32:35 +08:00
patch: decisionCard and popupCard of bing client (#505)
This commit is contained in:
@@ -101,7 +101,7 @@ function ConversationCard(props) {
|
||||
useEffect(async () => {
|
||||
// when the page is responsive, session may accumulate redundant data and needs to be cleared after remounting and before making a new request
|
||||
if (props.question) {
|
||||
const newSession = initSession({ question: props.question })
|
||||
const newSession = initSession({ ...session, question: props.question })
|
||||
setSession(newSession)
|
||||
await postMessage({ session: newSession })
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ async function mountComponent(siteConfig, userConfig) {
|
||||
container.id = 'chatgptbox-container'
|
||||
render(
|
||||
<DecisionCard
|
||||
session={initSession()}
|
||||
session={initSession({ modelName: (await getUserConfig()).modelName })}
|
||||
question={question}
|
||||
siteConfig={siteConfig}
|
||||
container={container}
|
||||
@@ -113,11 +113,11 @@ const deleteToolbar = () => {
|
||||
toolbarContainer.remove()
|
||||
}
|
||||
|
||||
const createSelectionTools = (toolbarContainer, selection) => {
|
||||
const createSelectionTools = async (toolbarContainer, selection) => {
|
||||
toolbarContainer.className = 'chatgptbox-toolbar-container'
|
||||
render(
|
||||
<FloatingToolbar
|
||||
session={initSession()}
|
||||
session={initSession({ modelName: (await getUserConfig()).modelName })}
|
||||
selection={selection}
|
||||
container={toolbarContainer}
|
||||
dockable={true}
|
||||
@@ -159,7 +159,7 @@ async function prepareForSelectionTools() {
|
||||
}
|
||||
}
|
||||
toolbarContainer = createElementAtPosition(position.x, position.y)
|
||||
createSelectionTools(toolbarContainer, selection)
|
||||
await createSelectionTools(toolbarContainer, selection)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user