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) {
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 }
Original file line number Diff line number Diff 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 } )
You can’t perform that action at this time.
0 commit comments