Skip to content

Commit 711e0d3

Browse files
committed
patch: decisionCard and popupCard of bing client (#505)
1 parent 18c9c4f commit 711e0d3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/ConversationCard/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function ConversationCard(props) {
101101
useEffect(async () => {
102102
// when the page is responsive, session may accumulate redundant data and needs to be cleared after remounting and before making a new request
103103
if (props.question) {
104-
const newSession = initSession({ question: props.question })
104+
const newSession = initSession({ ...session, question: props.question })
105105
setSession(newSession)
106106
await postMessage({ session: newSession })
107107
}

src/content-script/index.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async function mountComponent(siteConfig, userConfig) {
7373
container.id = 'chatgptbox-container'
7474
render(
7575
<DecisionCard
76-
session={initSession()}
76+
session={initSession({ modelName: (await getUserConfig()).modelName })}
7777
question={question}
7878
siteConfig={siteConfig}
7979
container={container}
@@ -113,11 +113,11 @@ const deleteToolbar = () => {
113113
toolbarContainer.remove()
114114
}
115115

116-
const createSelectionTools = (toolbarContainer, selection) => {
116+
const createSelectionTools = async (toolbarContainer, selection) => {
117117
toolbarContainer.className = 'chatgptbox-toolbar-container'
118118
render(
119119
<FloatingToolbar
120-
session={initSession()}
120+
session={initSession({ modelName: (await getUserConfig()).modelName })}
121121
selection={selection}
122122
container={toolbarContainer}
123123
dockable={true}
@@ -159,7 +159,7 @@ async function prepareForSelectionTools() {
159159
}
160160
}
161161
toolbarContainer = createElementAtPosition(position.x, position.y)
162-
createSelectionTools(toolbarContainer, selection)
162+
await createSelectionTools(toolbarContainer, selection)
163163
}
164164
})
165165
})

0 commit comments

Comments
 (0)