File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -458,15 +458,16 @@ export default class BingAIClient {
458458 return ;
459459 }
460460 // get the difference between the current text and the previous text
461- const difference = updatedText . substring ( replySoFar . length ) ;
462- onProgress ( difference ) ;
461+ const difference = messages [ 0 ] . messageType ? updatedText : updatedText . substring ( replySoFar . length ) ;
462+ onProgress ( difference , messages [ 0 ] . messageType ) ;
463463 if ( updatedText . trim ( ) . endsWith ( stopToken ) ) {
464464 stopTokenFound = true ;
465465 // remove stop token from updated text
466466 replySoFar = updatedText . replace ( stopToken , '' ) . trim ( ) ;
467467 return ;
468468 }
469- replySoFar = updatedText ;
469+ if ( ! messages [ 0 ] . messageType )
470+ replySoFar = updatedText ;
470471 return ;
471472 }
472473 case 2 : {
You can’t perform that action at this time.
0 commit comments