[FIX] Pass isFocused as a function to Messagebox (#1309)
This commit is contained in:
parent
20a73907ff
commit
c304904380
|
@ -65,7 +65,7 @@ class MessageBox extends Component {
|
||||||
replying: PropTypes.bool,
|
replying: PropTypes.bool,
|
||||||
editing: PropTypes.bool,
|
editing: PropTypes.bool,
|
||||||
threadsEnabled: PropTypes.bool,
|
threadsEnabled: PropTypes.bool,
|
||||||
isFocused: PropTypes.bool,
|
isFocused: PropTypes.func,
|
||||||
user: PropTypes.shape({
|
user: PropTypes.shape({
|
||||||
id: PropTypes.string,
|
id: PropTypes.string,
|
||||||
username: PropTypes.string,
|
username: PropTypes.string,
|
||||||
|
@ -166,7 +166,7 @@ class MessageBox extends Component {
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { isFocused, editing, replying } = this.props;
|
const { isFocused, editing, replying } = this.props;
|
||||||
if (!isFocused) {
|
if (!isFocused()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (editing !== nextProps.editing && nextProps.editing) {
|
if (editing !== nextProps.editing && nextProps.editing) {
|
||||||
|
@ -189,7 +189,7 @@ class MessageBox extends Component {
|
||||||
const {
|
const {
|
||||||
roomType, replying, editing, isFocused
|
roomType, replying, editing, isFocused
|
||||||
} = this.props;
|
} = this.props;
|
||||||
if (!isFocused) {
|
if (!isFocused()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (nextProps.roomType !== roomType) {
|
if (nextProps.roomType !== roomType) {
|
||||||
|
|
|
@ -732,7 +732,7 @@ class RoomView extends React.Component {
|
||||||
rid={this.rid}
|
rid={this.rid}
|
||||||
tmid={this.tmid}
|
tmid={this.tmid}
|
||||||
roomType={room.t}
|
roomType={room.t}
|
||||||
isFocused={navigation.isFocused()}
|
isFocused={navigation.isFocused}
|
||||||
message={selectedMessage}
|
message={selectedMessage}
|
||||||
editing={editing}
|
editing={editing}
|
||||||
editRequest={this.onEditRequest}
|
editRequest={this.onEditRequest}
|
||||||
|
|
Loading…
Reference in New Issue