File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11import './styles.scss'
2+ import { unmountComponentAtNode } from 'react-dom'
23import { render } from 'preact'
34import DecisionCard from '../components/DecisionCard'
45import { config as siteConfig } from './site-adapters'
@@ -27,13 +28,19 @@ async function mountComponent(siteConfig, userConfig) {
2728 )
2829 return
2930
30- document . querySelectorAll ( '.chat-gpt-container' ) . forEach ( ( e ) => e . remove ( ) )
31+ document . querySelectorAll ( '.chat-gpt-container' ) . forEach ( ( e ) => {
32+ unmountComponentAtNode ( e )
33+ e . remove ( )
34+ } )
3135
3236 let question
3337 if ( userConfig . inputQuery ) question = await getInput ( [ userConfig . inputQuery ] )
3438 if ( ! question && siteConfig ) question = await getInput ( siteConfig . inputQuery )
3539
36- document . querySelectorAll ( '.chat-gpt-container' ) . forEach ( ( e ) => e . remove ( ) )
40+ document . querySelectorAll ( '.chat-gpt-container' ) . forEach ( ( e ) => {
41+ unmountComponentAtNode ( e )
42+ e . remove ( )
43+ } )
3744 const container = document . createElement ( 'div' )
3845 container . className = 'chat-gpt-container'
3946 render (
You can’t perform that action at this time.
0 commit comments