position the inbound call box correctly, and fix various issues with when the video preview and callview are shown

This commit is contained in:
Matthew Hodgson 2015-12-17 02:53:53 +00:00
parent 856156ef5c
commit 1a90a2c426
4 changed files with 22 additions and 16 deletions

View file

@ -62,7 +62,7 @@ var LeftPanel = React.createClass({
// audio/video not crap out
var activeCall = CallHandler.getAnyActiveCall();
var callForRoom = CallHandler.getCallForRoom(selectedRoomId);
var showCall = (activeCall && !callForRoom);
var showCall = (activeCall && activeCall.call_state === 'connected' && !callForRoom);
this.setState({
showCallElement: showCall
});
@ -87,7 +87,6 @@ var LeftPanel = React.createClass({
render: function() {
var RoomList = sdk.getComponent('rooms.RoomList');
var BottomLeftMenu = sdk.getComponent('structures.BottomLeftMenu');
var IncomingCallBox = sdk.getComponent('voip.IncomingCallBox');
var collapseButton;
var classes = "mx_LeftPanel";
@ -100,7 +99,7 @@ var LeftPanel = React.createClass({
}
var callPreview;
if (this.state.showCallElement) {
if (this.state.showCallElement && !this.props.collapsed) {
var CallView = sdk.getComponent('voip.CallView');
callPreview = (
<CallView
@ -112,7 +111,6 @@ var LeftPanel = React.createClass({
return (
<aside className={classes}>
{ collapseButton }
<IncomingCallBox />
{ callPreview }
<RoomList
selectedRoom={this.props.selectedRoom}

View file

@ -64,7 +64,8 @@ var RoomSubList = React.createClass({
bottommost: React.PropTypes.bool,
selectedRoom: React.PropTypes.string.isRequired,
activityMap: React.PropTypes.object.isRequired,
collapsed: React.PropTypes.bool.isRequired
collapsed: React.PropTypes.bool.isRequired,
incomingCall: React.PropTypes.object,
},
getInitialState: function() {
@ -239,7 +240,9 @@ var RoomSubList = React.createClass({
selected={ selected }
unread={ self.props.activityMap[room.roomId] === 1 }
highlight={ self.props.activityMap[room.roomId] === 2 }
isInvite={ self.props.label === 'Invites' } />
isInvite={ self.props.label === 'Invites' }
incomingCall={ self.props.incomingCall && (self.props.incomingCall.roomId === room.roomId) ? self.props.incomingCall : null }
/>
);
});
},