forked from mystiq/hydrogen-web
Fix bug which caused subviews to not re-render
This commit is contained in:
parent
1b6d9db7cd
commit
7f653ab531
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue