(toolbarContainerElement, selection)
| 237 | } |
| 238 | |
| 239 | const createSelectionTools = async (toolbarContainerElement, selection) => { |
| 240 | console.debug( |
| 241 | '[content] createSelectionTools called with selection:', |
| 242 | selection, |
| 243 | 'and container:', |
| 244 | toolbarContainerElement, |
| 245 | ) |
| 246 | try { |
| 247 | toolbarContainerElement.className = 'chatgptbox-toolbar-container' |
| 248 | const userConfig = await getUserConfig() |
| 249 | render( |
| 250 | <FloatingToolbar |
| 251 | session={initSession({ |
| 252 | modelName: userConfig.modelName, |
| 253 | apiMode: userConfig.apiMode, |
| 254 | extraCustomModelName: userConfig.customModelName, |
| 255 | })} |
| 256 | selection={selection} |
| 257 | container={toolbarContainerElement} |
| 258 | dockable={true} |
| 259 | />, |
| 260 | toolbarContainerElement, |
| 261 | ) |
| 262 | console.log('[content] Selection tools rendered.') |
| 263 | } catch (error) { |
| 264 | console.error('[content] Error in createSelectionTools:', error) |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | let selectionToolsInitialized = false |
| 269 |
no test coverage detected