From c304904380b150d3e917b4b0461e401ee0c956e6 Mon Sep 17 00:00:00 2001 From: Calebe Rios Date: Mon, 28 Oct 2019 17:51:46 -0300 Subject: [PATCH] [FIX] Pass isFocused as a function to Messagebox (#1309) --- app/containers/MessageBox/index.js | 6 +++--- app/views/RoomView/index.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/containers/MessageBox/index.js b/app/containers/MessageBox/index.js index 5abdcbf4c..273a6bb9f 100644 --- a/app/containers/MessageBox/index.js +++ b/app/containers/MessageBox/index.js @@ -65,7 +65,7 @@ class MessageBox extends Component { replying: PropTypes.bool, editing: PropTypes.bool, threadsEnabled: PropTypes.bool, - isFocused: PropTypes.bool, + isFocused: PropTypes.func, user: PropTypes.shape({ id: PropTypes.string, username: PropTypes.string, @@ -166,7 +166,7 @@ class MessageBox extends Component { componentWillReceiveProps(nextProps) { const { isFocused, editing, replying } = this.props; - if (!isFocused) { + if (!isFocused()) { return; } if (editing !== nextProps.editing && nextProps.editing) { @@ -189,7 +189,7 @@ class MessageBox extends Component { const { roomType, replying, editing, isFocused } = this.props; - if (!isFocused) { + if (!isFocused()) { return false; } if (nextProps.roomType !== roomType) { diff --git a/app/views/RoomView/index.js b/app/views/RoomView/index.js index 6975599d1..a67b40324 100644 --- a/app/views/RoomView/index.js +++ b/app/views/RoomView/index.js @@ -732,7 +732,7 @@ class RoomView extends React.Component { rid={this.rid} tmid={this.tmid} roomType={room.t} - isFocused={navigation.isFocused()} + isFocused={navigation.isFocused} message={selectedMessage} editing={editing} editRequest={this.onEditRequest}