[FIX] Pass isFocused as a function to Messagebox (#1309)

This commit is contained in:
Calebe Rios 2019-10-28 17:51:46 -03:00 committed by Diego Mello
parent 20a73907ff
commit c304904380
2 changed files with 4 additions and 4 deletions

View File

@ -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) {

View File

@ -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}