Refactor the search stuff in RoomView

* factor out the call to MatrixClient.search to a separate _getSearchBatch (so
  that we can reuse it for paginated results in a bit)
* Don't group cross-room searches by room - just display them in timeline
  order.
This commit is contained in:
Richard van der Hoff 2015-12-18 11:11:41 +00:00 committed by review.rocks
parent 9931ef1971
commit 4b271a332e
2 changed files with 109 additions and 102 deletions

View file

@ -103,7 +103,9 @@ module.exports = React.createClass({
// <EditableText label={this.props.room.name} initialValue={actual_name} placeHolder="Name" onValueChanged={this.onNameChange} />
var searchStatus;
if (this.props.searchInfo && this.props.searchInfo.searchTerm) {
// don't display the search count until the search completes and
// gives us a non-null searchCount.
if (this.props.searchInfo && this.props.searchInfo.searchCount !== null) {
searchStatus = <div className="mx_RoomHeader_searchStatus">&nbsp;({ this.props.searchInfo.searchCount } results)</div>;
}