room sublist seems to get rendered w/o _scroll element

when loading the page from a community url
pull/21833/head
Bruno Windels 2018-12-10 16:51:32 +01:00
parent ab728ead72
commit 75925f6192
1 changed files with 3 additions and 0 deletions

View File

@ -38,6 +38,9 @@ class RoomSizer extends Sizer {
class RoomDistributor extends FixedDistributor { class RoomDistributor extends FixedDistributor {
resize(itemSize) { resize(itemSize) {
const scrollItem = this.item.querySelector(".mx_RoomSubList_scroll"); const scrollItem = this.item.querySelector(".mx_RoomSubList_scroll");
if (!scrollItem) {
return; //FIXME: happens when starting the page on a community url, taking the safe way out for now
}
const fixedHeight = this.item.offsetHeight - scrollItem.offsetHeight; const fixedHeight = this.item.offsetHeight - scrollItem.offsetHeight;
if (itemSize > (fixedHeight + scrollItem.scrollHeight)) { if (itemSize > (fixedHeight + scrollItem.scrollHeight)) {
super.resize("resized-all"); super.resize("resized-all");