File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
components/ConversationCard Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ function ConversationCard(props) {
101
101
useEffect ( async ( ) => {
102
102
// when the page is responsive, session may accumulate redundant data and needs to be cleared after remounting and before making a new request
103
103
if ( props . question ) {
104
- const newSession = initSession ( { question : props . question } )
104
+ const newSession = initSession ( { ... session , question : props . question } )
105
105
setSession ( newSession )
106
106
await postMessage ( { session : newSession } )
107
107
}
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ async function mountComponent(siteConfig, userConfig) {
73
73
container . id = 'chatgptbox-container'
74
74
render (
75
75
< DecisionCard
76
- session = { initSession ( ) }
76
+ session = { initSession ( { modelName : ( await getUserConfig ( ) ) . modelName } ) }
77
77
question = { question }
78
78
siteConfig = { siteConfig }
79
79
container = { container }
@@ -113,11 +113,11 @@ const deleteToolbar = () => {
113
113
toolbarContainer . remove ( )
114
114
}
115
115
116
- const createSelectionTools = ( toolbarContainer , selection ) => {
116
+ const createSelectionTools = async ( toolbarContainer , selection ) => {
117
117
toolbarContainer . className = 'chatgptbox-toolbar-container'
118
118
render (
119
119
< FloatingToolbar
120
- session = { initSession ( ) }
120
+ session = { initSession ( { modelName : ( await getUserConfig ( ) ) . modelName } ) }
121
121
selection = { selection }
122
122
container = { toolbarContainer }
123
123
dockable = { true }
@@ -159,7 +159,7 @@ async function prepareForSelectionTools() {
159
159
}
160
160
}
161
161
toolbarContainer = createElementAtPosition ( position . x , position . y )
162
- createSelectionTools ( toolbarContainer , selection )
162
+ await createSelectionTools ( toolbarContainer , selection )
163
163
}
164
164
} )
165
165
} )
You can’t perform that action at this time.
0 commit comments