@@ -66,13 +66,13 @@ interface IProps {
6666 onResize : ( ) => void ;
6767 resizeNotifier : ResizeNotifier ;
6868 isMinimized : boolean ;
69+ activeSpace : Room ;
6970}
7071
7172interface IState {
7273 sublists : ITagMap ;
7374 isNameFiltering : boolean ;
7475 currentRoomId ?: string ;
75- activeSpace : Room ;
7676 suggestedRooms : ISpaceSummaryRoom [ ] ;
7777}
7878
@@ -200,7 +200,7 @@ const TAG_AESTHETICS: ITagAestheticsMap = {
200200 />
201201 < IconizedContextMenuOption
202202 label = { _t ( "Explore rooms" ) }
203- iconClassName = "mx_RoomList_iconExplore "
203+ iconClassName = "mx_RoomList_iconBrowse "
204204 onClick = { ( e ) => {
205205 e . preventDefault ( ) ;
206206 e . stopPropagation ( ) ;
@@ -287,7 +287,6 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
287287 this . state = {
288288 sublists : { } ,
289289 isNameFiltering : ! ! RoomListStore . instance . getFirstNameFilterCondition ( ) ,
290- activeSpace : SpaceStore . instance . activeSpace ,
291290 suggestedRooms : SpaceStore . instance . suggestedRooms ,
292291 } ;
293292
@@ -300,15 +299,13 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
300299 }
301300
302301 public componentDidMount ( ) : void {
303- SpaceStore . instance . on ( UPDATE_SELECTED_SPACE , this . updateActiveSpace ) ;
304302 SpaceStore . instance . on ( SUGGESTED_ROOMS , this . updateSuggestedRooms ) ;
305303 RoomListStore . instance . on ( LISTS_UPDATE_EVENT , this . updateLists ) ;
306304 this . customTagStoreRef = CustomRoomTagStore . addListener ( this . updateLists ) ;
307305 this . updateLists ( ) ; // trigger the first update
308306 }
309307
310308 public componentWillUnmount ( ) {
311- SpaceStore . instance . off ( UPDATE_SELECTED_SPACE , this . updateActiveSpace ) ;
312309 SpaceStore . instance . off ( SUGGESTED_ROOMS , this . updateSuggestedRooms ) ;
313310 RoomListStore . instance . off ( LISTS_UPDATE_EVENT , this . updateLists ) ;
314311 defaultDispatcher . unregister ( this . dispatcherRef ) ;
@@ -374,10 +371,6 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
374371 return room ;
375372 } ;
376373
377- private updateActiveSpace = ( activeSpace : Room ) => {
378- this . setState ( { activeSpace } ) ;
379- } ;
380-
381374 private updateSuggestedRooms = ( suggestedRooms : ISpaceSummaryRoom [ ] ) => {
382375 this . setState ( { suggestedRooms } ) ;
383376 } ;
@@ -438,20 +431,20 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
438431
439432 private onSpaceInviteClick = ( ) => {
440433 const initialText = RoomListStore . instance . getFirstNameFilterCondition ( ) ?. search ;
441- if ( this . state . activeSpace . getJoinRule ( ) === "public" ) {
434+ if ( this . props . activeSpace . getJoinRule ( ) === "public" ) {
442435 const modal = Modal . createTrackedDialog ( "Space Invite" , "User Menu" , InfoDialog , {
443- title : _t ( "Invite to %(spaceName)s" , { spaceName : this . state . activeSpace . name } ) ,
436+ title : _t ( "Invite to %(spaceName)s" , { spaceName : this . props . activeSpace . name } ) ,
444437 description : < React . Fragment >
445438 < span > { _t ( "Share your public space" ) } </ span >
446- < SpacePublicShare space = { this . state . activeSpace } onFinished = { ( ) => modal . close ( ) } />
439+ < SpacePublicShare space = { this . props . activeSpace } onFinished = { ( ) => modal . close ( ) } />
447440 </ React . Fragment > ,
448441 fixedWidth : false ,
449442 button : false ,
450443 className : "mx_SpacePanel_sharePublicSpace" ,
451444 hasCloseButton : true ,
452445 } ) ;
453446 } else {
454- showRoomInviteDialog ( this . state . activeSpace . roomId , initialText ) ;
447+ showRoomInviteDialog ( this . props . activeSpace . roomId , initialText ) ;
455448 }
456449 } ;
457450
@@ -600,13 +593,13 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
600593 kind = "link"
601594 onClick = { this . onExplore }
602595 >
603- { this . state . activeSpace ? _t ( "Explore rooms" ) : _t ( "Explore all public rooms" ) }
596+ { this . props . activeSpace ? _t ( "Explore rooms" ) : _t ( "Explore all public rooms" ) }
604597 </ AccessibleButton >
605598 </ div > ;
606- } else if ( this . state . activeSpace ) {
599+ } else if ( this . props . activeSpace ) {
607600 explorePrompt = < div className = "mx_RoomList_explorePrompt" >
608601 < div > { _t ( "Quick actions" ) } </ div >
609- { this . state . activeSpace . canInvite ( MatrixClientPeg . get ( ) . getUserId ( ) ) && < AccessibleButton
602+ { this . props . activeSpace . canInvite ( MatrixClientPeg . get ( ) . getUserId ( ) ) && < AccessibleButton
610603 className = "mx_RoomList_explorePrompt_spaceInvite"
611604 onClick = { this . onSpaceInviteClick }
612605 >
0 commit comments