Skip to content

Commit f827a29

Browse files
authored
Merge pull request element-hq#2422 from vector-im/dbkr/fix_no_freenode_rooms
Don't stop paginating if no rooms match
2 parents cd7adfe + 5e293c0 commit f827a29

1 file changed

Lines changed: 20 additions & 15 deletions

File tree

src/components/structures/RoomDirectory.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -554,24 +554,29 @@ module.exports = React.createClass({
554554
</div>;
555555
} else {
556556
const rows = this.getRows();
557+
// we still show the scrollpanel, at least for now, because
558+
// otherwise we don't fetch more because we don't get a fill
559+
// request from the scrollpanel because there isn't one
560+
let scrollpanel_content;
557561
if (rows.length == 0) {
558-
content = <i>No rooms to show</i>;
562+
scrollpanel_content = <i>No rooms to show</i>;
559563
} else {
560-
const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
561-
content = <ScrollPanel ref={this.collectScrollPanel}
562-
className="mx_RoomDirectory_tableWrapper"
563-
onFillRequest={ this.onFillRequest }
564-
stickyBottom={false}
565-
startAtBottom={false}
566-
onResize={function(){}}
567-
>
568-
<table ref="directory_table" className="mx_RoomDirectory_table">
569-
<tbody>
570-
{ this.getRows() }
571-
</tbody>
572-
</table>
573-
</ScrollPanel>;
564+
scrollpanel_content = <table ref="directory_table" className="mx_RoomDirectory_table">
565+
<tbody>
566+
{ this.getRows() }
567+
</tbody>
568+
</table>;
574569
}
570+
const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
571+
content = <ScrollPanel ref={this.collectScrollPanel}
572+
className="mx_RoomDirectory_tableWrapper"
573+
onFillRequest={ this.onFillRequest }
574+
stickyBottom={false}
575+
startAtBottom={false}
576+
onResize={function(){}}
577+
>
578+
{ scrollpanel_content }
579+
</ScrollPanel>;
575580
}
576581

577582
let placeholder = 'Search for a room';

0 commit comments

Comments
 (0)