Merge pull request #2422 from vector-im/dbkr/fix_no_freenode_rooms

Don't stop paginating if no rooms match
This commit is contained in:
Richard van der Hoff 2016-10-06 10:39:45 +01:00 committed by GitHub
commit f827a2963e

View file

@ -554,24 +554,29 @@ module.exports = React.createClass({
</div>; </div>;
} else { } else {
const rows = this.getRows(); const rows = this.getRows();
// we still show the scrollpanel, at least for now, because
// otherwise we don't fetch more because we don't get a fill
// request from the scrollpanel because there isn't one
let scrollpanel_content;
if (rows.length == 0) { if (rows.length == 0) {
content = <i>No rooms to show</i>; scrollpanel_content = <i>No rooms to show</i>;
} else { } else {
const ScrollPanel = sdk.getComponent("structures.ScrollPanel"); scrollpanel_content = <table ref="directory_table" className="mx_RoomDirectory_table">
content = <ScrollPanel ref={this.collectScrollPanel} <tbody>
className="mx_RoomDirectory_tableWrapper" { this.getRows() }
onFillRequest={ this.onFillRequest } </tbody>
stickyBottom={false} </table>;
startAtBottom={false}
onResize={function(){}}
>
<table ref="directory_table" className="mx_RoomDirectory_table">
<tbody>
{ this.getRows() }
</tbody>
</table>
</ScrollPanel>;
} }
const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
content = <ScrollPanel ref={this.collectScrollPanel}
className="mx_RoomDirectory_tableWrapper"
onFillRequest={ this.onFillRequest }
stickyBottom={false}
startAtBottom={false}
onResize={function(){}}
>
{ scrollpanel_content }
</ScrollPanel>;
} }
let placeholder = 'Search for a room'; let placeholder = 'Search for a room';