You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-22 04:02:40 +03:00
resubmit query when switching between "This Room" / "All Rooms"
This commit is contained in:
@@ -33,11 +33,11 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onThisRoomClick: function() {
|
onThisRoomClick: function() {
|
||||||
this.setState({ scope: 'Room' });
|
this.setState({ scope: 'Room' }, () => this._searchIfQuery());
|
||||||
},
|
},
|
||||||
|
|
||||||
onAllRoomsClick: function() {
|
onAllRoomsClick: function() {
|
||||||
this.setState({ scope: 'All' });
|
this.setState({ scope: 'All' }, () => this._searchIfQuery());
|
||||||
},
|
},
|
||||||
|
|
||||||
onSearchChange: function(e) {
|
onSearchChange: function(e) {
|
||||||
@@ -49,6 +49,12 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_searchIfQuery: function() {
|
||||||
|
if (this.refs.search_term.value) {
|
||||||
|
this.onSearch();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onSearch: function() {
|
onSearch: function() {
|
||||||
this.props.onSearch(this.refs.search_term.value, this.state.scope);
|
this.props.onSearch(this.refs.search_term.value, this.state.scope);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user