From 7f653ab531e92f0091363b0a1ace4e283f4872e1 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 7 Dec 2021 15:20:45 +0000 Subject: [PATCH] Fix bug which caused subviews to not re-render --- src/platform/web/ui/session/leftpanel/LeftPanelView.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/web/ui/session/leftpanel/LeftPanelView.js b/src/platform/web/ui/session/leftpanel/LeftPanelView.js index 855d9d12..af4cd66b 100644 --- a/src/platform/web/ui/session/leftpanel/LeftPanelView.js +++ b/src/platform/web/ui/session/leftpanel/LeftPanelView.js @@ -70,6 +70,10 @@ export class LeftPanelView extends TemplateView { vm.loadRoomRange(range); }, shouldRecreateItem: (value, oldValue) => { + return true; + // TODO: We used to just recreate the item if the underlying view model was swapped out e.g ph->room + // but there is also a need to recreate items on room->room transitions (to re-make the + // subviews), so just always recreate views for now. const isOldRoom = oldValue instanceof RoomTileViewModel; const isNewRoom = value instanceof RoomTileViewModel; return isOldRoom != isNewRoom;