mirror of
				https://github.com/vector-im/element-web.git
				synced 2025-11-04 10:11:03 +01:00 
			
		
		
		
	Don't stop paginating if no rooms match
Always show the scrollpanel otherwise we stop paginating if there are no matching rooms in the first request (as per comment). Fixes no freenode rooms being shown.
This commit is contained in:
		
							parent
							
								
									cd7adfed0a
								
							
						
					
					
						commit
						5e293c0f45
					
				@ -554,9 +554,19 @@ 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 {
 | 
				
			||||||
 | 
					                scrollpanel_content = <table ref="directory_table" className="mx_RoomDirectory_table">
 | 
				
			||||||
 | 
					                    <tbody>
 | 
				
			||||||
 | 
					                        { this.getRows() }
 | 
				
			||||||
 | 
					                    </tbody>
 | 
				
			||||||
 | 
					                </table>;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
 | 
					            const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
 | 
				
			||||||
            content = <ScrollPanel ref={this.collectScrollPanel}
 | 
					            content = <ScrollPanel ref={this.collectScrollPanel}
 | 
				
			||||||
                className="mx_RoomDirectory_tableWrapper"
 | 
					                className="mx_RoomDirectory_tableWrapper"
 | 
				
			||||||
@ -565,14 +575,9 @@ module.exports = React.createClass({
 | 
				
			|||||||
                startAtBottom={false}
 | 
					                startAtBottom={false}
 | 
				
			||||||
                onResize={function(){}}
 | 
					                onResize={function(){}}
 | 
				
			||||||
            >
 | 
					            >
 | 
				
			||||||
                    <table ref="directory_table" className="mx_RoomDirectory_table">
 | 
					                { scrollpanel_content }
 | 
				
			||||||
                        <tbody>
 | 
					 | 
				
			||||||
                            { this.getRows() }
 | 
					 | 
				
			||||||
                        </tbody>
 | 
					 | 
				
			||||||
                    </table>
 | 
					 | 
				
			||||||
            </ScrollPanel>;
 | 
					            </ScrollPanel>;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        let placeholder = 'Search for a room';
 | 
					        let placeholder = 'Search for a room';
 | 
				
			||||||
        if (this.state.network === null || this.state.network === '_matrix') {
 | 
					        if (this.state.network === null || this.state.network === '_matrix') {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user