From cfb9172121d1415b58fddcc3cfc609edff5226a8 Mon Sep 17 00:00:00 2001 From: YaoiFangirl420 <48789208+YaoiFangirl420@users.noreply.github.com> Date: Sat, 6 Apr 2019 20:48:13 -0700 Subject: [PATCH] Tighten up code around call buttons Signed-off-by: YaoiFangirl420 <48789208+YaoiFangirl420@users.noreply.github.com> --- src/components/views/rooms/MessageComposer.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 089fbc13f4..353b7cc643 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -293,23 +293,14 @@ export default class MessageComposer extends React.Component { const uploadInputStyle = {display: 'none'}; const MessageComposerInput = sdk.getComponent("rooms.MessageComposerInput"); + const callInProgress = this.props.callState && this.props.callState !== 'ended'; + const controls = [ this.state.me ? : null, this.props.e2eStatus ? : null, ]; - let callButton; - let videoCallButton; - let hangupButton; - const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); - // Call buttons - if (this.props.callState && this.props.callState !== 'ended') { - hangupButton = ; - } else { - callButton = ; - videoCallButton = ; - } if (!this.state.tombstone && this.state.canSendMessages) { // This also currently includes the call buttons. Really we should @@ -367,9 +358,9 @@ export default class MessageComposer extends React.Component { formattingButton, stickerpickerButton, uploadButton, - hangupButton, - callButton, - videoCallButton, + callInProgress ? : null, + callInProgress ? null : , + callInProgress ? null : , ); } else if (this.state.tombstone) { const replacementRoomId = this.state.tombstone.getContent()['replacement_room'];