vector-im-hydrogen-web/src/domain/session/room
Bruno Windels 0b04612d6c WIP2
2022-02-04 11:16:58 +01:00
..
timeline ensure images load in reply preview in timeline 2022-01-17 16:48:36 +01:00
ComposerViewModel.js ensure images load in reply preview in composer 2022-01-17 16:48:17 +01:00
InviteViewModel.js Correctly color archived and invited rooms 2021-06-29 16:50:42 -07:00
LightboxViewModel.js implement first draft of image lightbox 2020-10-30 15:20:11 +01:00
README.md WIP 2022-02-03 17:57:35 +01:00
RoomBeingCreatedViewModel.js WIP 2022-02-03 17:57:35 +01:00
RoomViewModel.js WIP2 2022-02-04 11:16:58 +01:00
UnknownRoomViewModel.js clarify with comments 2021-05-18 11:54:18 +02:00

"Room" view models

InviteViewModel, RoomViewModel and RoomBeingCreatedViewModel are interchangebly used as "room view model": - SessionViewModel.roomViewModel can be an instance of any - RoomGridViewModel.roomViewModelAt(i) can return an instance of any

This is because they are accessed by the same url and need to transition into each other, in these two locations. Having two methods, especially in RoomGridViewModel would have been more cumbersome, even though this is not in line with how different view models are exposed in SessionViewModel.

They share an id and kind property, the latter can be used to differentiate them from the view, and a focus method. Once we convert this folder to typescript, we should use this interface for all the view models:

interface IGridItemViewModel {
    id: string;
    kind: string;
    focus();
}