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_SCROLLpull/21833/head
parent
583d35e39f
commit
4730179c26
|
@ -366,7 +366,9 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
if (this.state.searchResults.next_batch) {
|
if (this.state.searchResults.next_batch) {
|
||||||
debuglog("requesting more search results");
|
debuglog("requesting more search results");
|
||||||
return this._backPaginateSearch();
|
var searchPromise = MatrixClientPeg.get().backPaginateRoomEventsSearch(
|
||||||
|
this.state.searchResults);
|
||||||
|
return this._handleSearchResult(searchPromise);
|
||||||
} else {
|
} else {
|
||||||
debuglog("no more search results");
|
debuglog("no more search results");
|
||||||
return q(false);
|
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({
|
var searchPromise = MatrixClientPeg.get().searchRoomEvents({
|
||||||
filter: filter,
|
filter: filter,
|
||||||
|
@ -520,14 +522,6 @@ module.exports = React.createClass({
|
||||||
this._handleSearchResult(searchPromise).done();
|
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) {
|
_handleSearchResult: function(searchPromise) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue