You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-06-27 15:01:53 +03:00
Add a 'top-of-search' marker
Ugly as hell, pending better suggestions. This fixes https://github.com/vector-im/vector-web/issues/547
This commit is contained in:
@ -521,6 +521,7 @@ module.exports = React.createClass({
|
||||
searchResults: [],
|
||||
searchHighlights: [],
|
||||
searchCount: null,
|
||||
searchCanPaginate: null,
|
||||
});
|
||||
|
||||
this.savedSearchScrollState = {atBottom: true};
|
||||
@ -579,6 +580,7 @@ module.exports = React.createClass({
|
||||
searchHighlights: highlights,
|
||||
searchResults: events,
|
||||
searchCount: results.count,
|
||||
searchCanPaginate: !!(results.next_batch),
|
||||
});
|
||||
self.nextSearchBatch = results.next_batch;
|
||||
}, function(error) {
|
||||
@ -639,6 +641,13 @@ module.exports = React.createClass({
|
||||
|
||||
var lastRoomId;
|
||||
|
||||
if (this.state.searchCanPaginate === false) {
|
||||
ret.push(<li key="search-top-marker">
|
||||
<h2 className="mx_RoomView_topMarker">End of search results</h2>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
for (var i = this.state.searchResults.length - 1; i >= 0; i--) {
|
||||
var result = this.state.searchResults[i];
|
||||
var mxEv = new Matrix.MatrixEvent(result.result);
|
||||
|
Reference in New Issue
Block a user