File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,14 @@ function setWindowSubtitle(subtitle?: string) {
3030 document . title = subtitle ? `${ WINDOW_TITLE } - ${ subtitle } ` : WINDOW_TITLE ;
3131}
3232
33+ function getRoomSubtitle ( roomInfo : GMCPMessageRoomInfo ) : string | undefined {
34+ if ( roomInfo . area && roomInfo . name ) {
35+ return `${ roomInfo . area } : ${ roomInfo . name } ` ;
36+ }
37+
38+ return roomInfo . name || roomInfo . area || undefined ;
39+ }
40+
3341function App ( ) {
3442 const [ client , setClient ] = useState < MudClient | null > ( null ) ;
3543 const [ showSidebar , setShowSidebar ] = useState < boolean > ( false ) ;
@@ -189,7 +197,7 @@ function App() {
189197 }
190198
191199 const handleRoomInfo = ( roomInfo : GMCPMessageRoomInfo ) => {
192- setWindowSubtitle ( roomInfo . name ) ;
200+ setWindowSubtitle ( getRoomSubtitle ( roomInfo ) ) ;
193201 } ;
194202 const handleDisconnect = ( ) => {
195203 setWindowSubtitle ( ) ;
You can’t perform that action at this time.
0 commit comments