From cde3f33db39af2ccba4ca68bfaab624e35b1f7df Mon Sep 17 00:00:00 2001 From: wmwragg Date: Thu, 15 Sep 2016 14:37:53 +0100 Subject: [PATCH] Added incomingCallBox to header and removed from roomTile --- src/components/structures/RoomSubList.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 224ff2c6..16491d49 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -383,7 +383,7 @@ var RoomSubList = React.createClass({ highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' } isInvite={ self.props.label === 'Invites' } 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 = ; + } + } + return (
@@ -436,6 +450,7 @@ var RoomSubList = React.createClass({
{badge}
+ { incomingCall }
); },