@@ -5,11 +5,11 @@ import ReactDOM from 'react-dom';
55import InlineInput from './InlineInput' ;
66import ProfilePictureView from './ProfilePictureView' ;
77import SessionController , { SessionControllerEventListener } from '../controllers/SessionController' ;
8- import { TableInfo } from '../models/TableInfo' ;
98import TablePreview from '../table/TablePreview' ;
109
1110import { ChatMessage } from '../models/ChatMessage' ;
1211import { SessionState } from '../models/SessionState' ;
12+ import { TableInfo } from '../models/TableInfo' ;
1313
1414import IconExpand from '../images/icon_expand.svg'
1515import LogoInverted from '../images/logo_inverted.svg'
@@ -144,14 +144,14 @@ class AssistantView extends React.Component<Props, State> implements SessionCont
144144 }
145145 } ) }
146146 </ div >
147- { modalContent && ReactDOM . createPortal (
148- < div style = { { position : 'absolute' , top : 0 , left : 0 , width : '100vw' , height : '100vh' , backgroundColor : 'rgba(0, 0, 0, 0.75)' , zIndex : 10000 , boxSizing : 'border-box' , padding : '32px' , display : 'flex' , alignItems : 'center' , justifyContent : 'center' } } onClick = { ( ) => this . setState ( { modalContent : null } ) } >
147+ { modalContent && ReactDOM . createPortal (
148+ < div style = { { position : 'absolute' , top : '0px' , left : '0px' , width : '100vw' , height : '100vh' , backgroundColor : 'rgba(0, 0, 0, 0.75)' , zIndex : 10000 , boxSizing : 'border-box' , padding : '32px' , display : 'flex' , alignItems : 'center' , justifyContent : 'center' } } onClick = { ( ) => this . setState ( { modalContent : null } ) } >
149149 < div style = { { maxWidth : '100%' , maxHeight : '100%' } } >
150150 < TableView table = { modalContent } style = { { maxHeight : 'calc(100vh - 64px)' } } />
151151 </ div >
152152 </ div > ,
153153 document . body
154- ) }
154+ ) }
155155 </ div >
156156 } else if ( sessionState == 'initializing' || sessionState == 'waiting_for_data' || sessionState == 'validating_data' ) {
157157 return < div style = { { width : '100%' , height : '100%' , display : 'flex' , flexDirection : 'column' , justifyContent : 'center' , alignItems : 'center' } } >
@@ -178,8 +178,8 @@ class AssistantView extends React.Component<Props, State> implements SessionCont
178178
179179 sendChatMessage ( ) {
180180 const message = this . inputRef . current ?. getContent ( ) ?? null ;
181- const { isProcessing } = this . state ;
182- if ( ! message || message . length == 0 || isProcessing ) { return ; }
181+ const { sessionState , isProcessing } = this . state ;
182+ if ( ! message || message . length == 0 || isProcessing || sessionState != 'ready' ) { return ; }
183183 this . inputRef . current ?. clear ( ) ;
184184 SessionController . getInstance ( ) . sendChatMessage ( message ) ;
185185 }
0 commit comments