Merge pull request #2222 from vector-im/wmwragg/correct-incoming-call-positioning

Wmwragg/correct incoming call positioning
This commit is contained in:
Matthew Hodgson 2016-09-15 15:59:14 +01:00 committed by GitHub
commit 866164c4d9
1 changed files with 18 additions and 3 deletions

View File

@ -383,7 +383,7 @@ var RoomSubList = React.createClass({
highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' } highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' }
isInvite={ self.props.label === 'Invites' } isInvite={ self.props.label === 'Invites' }
refreshSubList={ self._updateSubListCount } refreshSubList={ self._updateSubListCount }
incomingCall={ self.props.incomingCall && (self.props.incomingCall.roomId === room.roomId) ? self.props.incomingCall : null } /> incomingCall={ null } />
); );
}); });
}, },
@ -428,6 +428,20 @@ var RoomSubList = React.createClass({
} }
} }
var incomingCall;
if (this.props.incomingCall) {
var self = this;
// Check if the incoming call is for this section
var incomingCallRoom = this.state.sortedList.filter(function(room) {
return self.props.incomingCall.roomId === room.roomId;
});
if (incomingCallRoom.length === 1) {
var IncomingCallBox = sdk.getComponent("voip.IncomingCallBox");
incomingCall = <IncomingCallBox className="mx_RoomSubList_incomingCall" incomingCall={ this.props.incomingCall }/>;
}
}
return ( return (
<div className="mx_RoomSubList_labelContainer" title={ title } ref="header"> <div className="mx_RoomSubList_labelContainer" title={ title } ref="header">
<div onClick={ this.onClick } className="mx_RoomSubList_label"> <div onClick={ this.onClick } className="mx_RoomSubList_label">
@ -435,6 +449,7 @@ var RoomSubList = React.createClass({
<div className="mx_RoomSubList_roomCount">{ roomCount }</div> <div className="mx_RoomSubList_roomCount">{ roomCount }</div>
<div className={chevronClasses}></div> <div className={chevronClasses}></div>
{ badge } { badge }
{ incomingCall }
</div> </div>
</div> </div>
); );