File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
tools/server/public_simplechat Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ class SimpleChat {
367367 if ( iRecentUserMsgCnt == 0 ) {
368368 console . warn ( "WARN:SimpleChat:SC:RecentChat:iRecentUsermsgCnt of 0 means no user message/query sent" ) ;
369369 }
370- /** @type {ChatMessages } */
370+ /** @type {ChatMessages } */
371371 let rchat = [ ] ;
372372 let sysMsg = this . get_system_latest ( ) ;
373373 if ( sysMsg . ns . content . length != 0 ) {
@@ -493,16 +493,16 @@ class SimpleChat {
493493 div . replaceChildren ( ) ;
494494 }
495495 let last = undefined ;
496- for ( const x of this . recent_chat ( gMe . chatProps . iRecentUserMsgCnt ) ) {
497- if ( x . ns . role != Roles . ToolTemp ) {
498- let entry = ui . el_create_append_p ( `${ x . ns . role } : ${ x . content_equiv ( ) } ` , div ) ;
499- entry . className = `role-${ x . ns . role } ` ;
500- last = entry ;
501- } else {
502- if ( elInUser ) {
496+ for ( const [ i , x ] of this . recent_chat ( gMe . chatProps . iRecentUserMsgCnt ) . entries ( ) ) {
497+ if ( x . ns . role === Roles . ToolTemp ) {
498+ if ( i == ( this . xchat . length - 1 ) ) {
503499 elInUser . value = x . ns . content ;
504500 }
501+ continue
505502 }
503+ let entry = ui . el_create_append_p ( `${ x . ns . role } : ${ x . content_equiv ( ) } ` , div ) ;
504+ entry . className = `role-${ x . ns . role } ` ;
505+ last = entry ;
506506 }
507507 if ( last !== undefined ) {
508508 last . scrollIntoView ( false ) ;
You can’t perform that action at this time.
0 commit comments