Fix slight mis-merge

We need to return 'true' from our promise of search result pagination.

Also inline _backPaginateSearch which mostly served to confuse, and use
debuglog instead of checking DEBUG_SCROLL
pull/21833/head
Richard van der Hoff 2016-01-05 15:51:16 +00:00
parent 583d35e39f
commit 4730179c26
1 changed files with 4 additions and 10 deletions

View File

@ -366,7 +366,9 @@ module.exports = React.createClass({
if (this.state.searchResults.next_batch) {
debuglog("requesting more search results");
return this._backPaginateSearch();
var searchPromise = MatrixClientPeg.get().backPaginateRoomEventsSearch(
this.state.searchResults);
return this._handleSearchResult(searchPromise);
} else {
debuglog("no more search results");
return q(false);
@ -511,7 +513,7 @@ module.exports = React.createClass({
};
}
if (DEBUG_SCROLL) console.log("sending search request");
debuglog("sending search request");
var searchPromise = MatrixClientPeg.get().searchRoomEvents({
filter: filter,
@ -520,14 +522,6 @@ module.exports = React.createClass({
this._handleSearchResult(searchPromise).done();
},
_backPaginateSearch: function() {
if (DEBUG_SCROLL) console.log("sending search back-paginate request");
var searchPromise = MatrixClientPeg.get().backPaginateRoomEventsSearch(
this.state.searchResults);
return this._handleSearchResult(searchPromise);
},
_handleSearchResult: function(searchPromise) {
var self = this;