about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Pages/Rooms/Index.razor
blob: 932748d27f49527abcdfda922acb90a7276ea420 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@page "/Rooms"
@using MatrixRoomUtils.Core.StateEventTypes
<h3>Room list</h3>

@if (Rooms is not null) {
    <RoomList Rooms="Rooms" GlobalProfile="@GlobalProfile"></RoomList>
}


@code {

    private List<GenericRoom> Rooms { get; set; }
    private ProfileResponse GlobalProfile { get; set; }
    
    protected override async Task OnInitializedAsync() {
        var hs = await MRUStorage.GetCurrentSessionOrNavigate();
        if (hs is null) return;
        GlobalProfile = await hs.GetProfile(hs.WhoAmI.UserId);
        Rooms = await hs.GetJoinedRooms();

        await base.OnInitializedAsync();
    }

}