From 0a31bd169c9ba6a31049e16aaccf1734db2a61fb Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 24 Jul 2020 10:20:00 -0600 Subject: [PATCH] Skip updates in collapsed lists too --- src/components/views/rooms/RoomSublist.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/views/rooms/RoomSublist.tsx b/src/components/views/rooms/RoomSublist.tsx index 6438455a0a..edbdfc0a2c 100644 --- a/src/components/views/rooms/RoomSublist.tsx +++ b/src/components/views/rooms/RoomSublist.tsx @@ -202,6 +202,13 @@ export default class RoomSublist extends React.Component { return true; } + // Before we go analyzing the rooms, we can see if we're collapsed. If we're collapsed, we don't need + // to render anything. We do this after the height check though to ensure that the height gets appropriately + // calculated for when/if we become uncollapsed. + if (!nextState.isExpanded) { + return false; + } + // Quickly double check we're not about to break something due to the number of rooms changing. if (this.state.rooms.length !== nextState.rooms.length) { return true;