diff --git a/src/views/messages-view.jsx b/src/views/messages-view.jsx index def9cc88..61033422 100644 --- a/src/views/messages-view.jsx +++ b/src/views/messages-view.jsx @@ -115,7 +115,7 @@ class MessagesView extends React.Component { this.handleCancelReply = this.handleCancelReply.bind(this); this.handleQuoteClick = this.handleQuoteClick.bind(this); this.handleRtcClick = this.handleRtcClick.bind(this); - this.handleRtcClose = this.handleRtcClose.bind(this); + this.handleTeleHangup = this.handleTeleHangup.bind(this); this.chatMessageRefs = {}; this.getOrCreateMessageRef = this.getOrCreateMessageRef.bind(this); @@ -167,8 +167,7 @@ class MessagesView extends React.Component { this.leave(prevState.topic); if (prevState.rtcPanel) { console.log('hangup: ', prevState.topic); - this.props.onTeleHangup(prevState.topic, prevProps.callSeq); - this.handleRtcClose(); + this.handleTeleHangup(prevState.topic, prevProps.callSeq); } } @@ -781,24 +780,17 @@ class MessagesView extends React.Component { handleRtcClick() { this.setState({ - rtcPanel: { - /* - file: file, - name: file.name, - size: file.size, - type: file.type - */ - topic: this.state.topic - } + rtcPanel: { topic: this.state.topic } }); } - handleRtcClose() { + handleTeleHangup(topic, seq) { this.props.onVideoCallClosed(); this.setState({ rtcPanel: null }); + this.props.onTeleHangup(topic, seq); } // sendImageAttachment sends the image bits inband as Drafty message. @@ -993,15 +985,11 @@ class MessagesView extends React.Component { seq={this.props.callSeq} callState={this.props.callState} onError={this.props.onError} - onClose={this.handleRtcClose} - onHangup={this.props.onTeleHangup} - + onHangup={this.handleTeleHangup} onInvite={this.props.onTeleInvite} onSendOffer={this.props.onTeleSendOffer} onIceCandidate={this.props.onTeleIceCandidate} onSendAnswer={this.props.onTeleSendAnswer} - //content={this.state.imagePostview} - //onClose={this.handleClosePreview} /> ); } else { @@ -1194,7 +1182,6 @@ class MessagesView extends React.Component { ); } - // component =
{component2}
} return component; diff --git a/src/widgets/rtc-panel.jsx b/src/widgets/rtc-panel.jsx index da49f0a5..d08d4e18 100644 --- a/src/widgets/rtc-panel.jsx +++ b/src/widgets/rtc-panel.jsx @@ -309,8 +309,6 @@ export default class RtcPanel extends React.PureComponent { handleCloseClick() { this.stop(); this.props.onHangup(this.props.topic.name, this.props.seq); - - this.props.onClose(); } toggleMedia(kind) {