File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ module.exports = {
3333 cli . on ( "Room" , this . onRoom ) ;
3434 cli . on ( "Room.timeline" , this . onRoomTimeline ) ;
3535 cli . on ( "Room.name" , this . onRoomName ) ;
36+ cli . on ( "RoomState.events" , this . onRoomStateEvents ) ;
3637
3738 var rooms = this . getRoomList ( ) ;
3839 this . setState ( {
@@ -66,6 +67,7 @@ module.exports = {
6667 MatrixClientPeg . get ( ) . removeListener ( "Room" , this . onRoom ) ;
6768 MatrixClientPeg . get ( ) . removeListener ( "Room.timeline" , this . onRoomTimeline ) ;
6869 MatrixClientPeg . get ( ) . removeListener ( "Room.name" , this . onRoomName ) ;
70+ MatrixClientPeg . get ( ) . removeListener ( "RoomState.events" , this . onRoomStateEvents ) ;
6971 }
7072 } ,
7173
@@ -110,6 +112,11 @@ module.exports = {
110112 this . refreshRoomList ( ) ;
111113 } ,
112114
115+ onRoomStateEvents : function ( ev , state ) {
116+ setTimeout ( this . refreshRoomList , 0 ) ;
117+ } ,
118+
119+
113120 refreshRoomList : function ( ) {
114121 var rooms = this . getRoomList ( ) ;
115122 this . setState ( {
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ module.exports = React.createClass({
4444
4545 render : function ( ) {
4646 var style = {
47- 'max-width' : this . props . width ,
48- 'max-height' : this . props . height ,
47+ maxWidth : this . props . width ,
48+ maxHeight : this . props . height ,
4949 } ;
5050 return (
5151 < img className = "mx_RoomAvatar" src = { this . state . imageUrl } onError = { this . onError }
Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ module.exports = React.createClass({
4747 if ( this . props . room && ! this . avatarSet ) {
4848 avatarImg = < RoomAvatar room = { this . props . room } width = '320' height = '240' resizeMethod = 'scale' /> ;
4949 } else {
50- avatarImg = < img src = { this . state . avatarUrl } /> ;
50+ var style = {
51+ maxWidth : 320 ,
52+ maxHeight : 240 ,
53+ } ;
54+ avatarImg = < img src = { this . state . avatarUrl } style = { style } /> ;
5155 }
5256
5357 switch ( this . state . phase ) {
You can’t perform that action at this time.
0 commit comments