File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 285285 font-style : italic;
286286 }
287287
288+ .connection-message {
289+ color : # 666600 ;
290+ font-style : italic;
291+ opacity : 0.6 ;
292+ }
293+
288294 .input-container {
289295 background : # 001100 ;
290296 border-top : 2px solid # 00ff00 ;
571577
572578 handlePeerConnect ( peerId ) {
573579 this . updateConnectionStatus ( ) ;
574- this . addSystemMessage ( `Peer connected: ...${ peerId . toString ( ) . substring ( 10 , 20 ) } ...` ) ;
580+ this . addConnectionMessage ( `Peer connected: ...${ peerId . toString ( ) . substring ( 10 , 20 ) } ...` ) ;
575581
576582 // Show the initial connection message only once when first peer connects
577583 if ( ! this . hasShownConnectedMessage ) {
582588
583589 handlePeerDisconnect ( peerId ) {
584590 this . updateConnectionStatus ( ) ;
585- this . addSystemMessage ( `Peer disconnected: ...${ peerId . toString ( ) . substring ( 10 , 20 ) } ...` ) ;
591+ this . addConnectionMessage ( `Peer disconnected: ...${ peerId . toString ( ) . substring ( 10 , 20 ) } ...` ) ;
586592 }
587593
588594 updateConnectionStatus ( ) {
862868 this . scrollToBottom ( ) ;
863869 }
864870
871+ addConnectionMessage ( text ) {
872+ const messageElement = document . createElement ( 'div' ) ;
873+ messageElement . className = 'message connection-message' ;
874+ messageElement . innerHTML = `
875+ <div class="message-content">[SYSTEM] ${ text } </div>
876+ ` ;
877+
878+ this . chatContainer . appendChild ( messageElement ) ;
879+ this . scrollToBottom ( ) ;
880+ }
881+
865882 escapeHtml ( text ) {
866883 const div = document . createElement ( 'div' ) ;
867884 div . textContent = text ;
You can’t perform that action at this time.
0 commit comments