@@ -110,8 +110,9 @@ class App extends React.Component {
110110 // TODO: wrap in a settimeout of 0
111111 // this puts it within the event loop
112112 // so that rendering
113+ const firstCallVal = true ;
113114 setTimeout ( ( ) => {
114- this . routeToPath ( this . state . paths [ 0 ] ) ;
115+ this . routeToPath ( this . state . paths [ 0 ] , firstCallVal ) ;
115116 } , 0 ) ;
116117 }
117118
@@ -183,8 +184,8 @@ class App extends React.Component {
183184 actions . forEach ( ( act ) => {
184185 executeClientAction ( act )
185186 . then ( ( result ) => {
186- if ( ! outputObj . context . skip_user_input ) {
187- this . sendMessageToConversation ( result . result , this . state . lastMessageContext ) ;
187+ if ( outputObj . context === undefined ) {
188+ this . sendMessageToConversation ( result . result ) ;
188189 } else if ( result . result === 'statement' ) {
189190 const action = executeWorkspaceAction ( { statement_display : result . dates } ) ;
190191 responses . push ( action ) ;
@@ -246,7 +247,7 @@ class App extends React.Component {
246247 }
247248 }
248249
249- routeToPath ( path ) {
250+ routeToPath ( path , firstCallVal ) {
250251 trackEvent ( 'Navigated to Panel' , 'Button' , 'NavButton' ) ;
251252 this . setState ( { messages : [ ] } ) ;
252253 this . setState ( { currentPath : path . id } ) ;
@@ -255,7 +256,7 @@ class App extends React.Component {
255256 // the fetchMessage call clears the existing context
256257 // the sendMessageToConversation call sets the context to the selected
257258 // path
258- fetchMessage ( '' , null , ( err , data ) => {
259+ fetchMessage ( '' , null , firstCallVal , ( err , data ) => {
259260 if ( data ) {
260261 this . updateConversationContext ( data . context ) ;
261262 this . sendMessageToConversation ( path . path , this . state . lastMessageContext ) ;
@@ -267,7 +268,7 @@ class App extends React.Component {
267268 sendMessageToConversation ( text , context = null ) {
268269 this . updateMessageStatus ( IN_PROGRESS ) ;
269270
270- fetchMessage ( text , context , ( err , data ) => {
271+ fetchMessage ( text , context , false , ( err , data ) => {
271272 // data.code is set for an error response
272273 if ( err || data . code !== undefined ) {
273274 this . updateMessageStatus ( FAILED ) ;
0 commit comments