diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-07-02 01:01:09 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-07-02 01:01:09 +0200 |
commit | def33cc092ae2c6defcc218b108b7c99cbfb8581 (patch) | |
tree | ba992ff8c30b7d4e8af0a78350e157e095455a18 /MatrixRoomUtils.Web/Pages/Rooms/Index.razor | |
parent | Deduplicate some api calls (diff) | |
download | MatrixUtils-def33cc092ae2c6defcc218b108b7c99cbfb8581.tar.xz |
Prefetch room info
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/Rooms/Index.razor')
-rw-r--r-- | MatrixRoomUtils.Web/Pages/Rooms/Index.razor | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/MatrixRoomUtils.Web/Pages/Rooms/Index.razor b/MatrixRoomUtils.Web/Pages/Rooms/Index.razor index 932748d..d88d5b2 100644 --- a/MatrixRoomUtils.Web/Pages/Rooms/Index.razor +++ b/MatrixRoomUtils.Web/Pages/Rooms/Index.razor @@ -1,5 +1,6 @@ @page "/Rooms" @using MatrixRoomUtils.Core.StateEventTypes +@using MatrixRoomUtils.Core.StateEventTypes.Spec <h3>Room list</h3> @if (Rooms is not null) { @@ -9,14 +10,14 @@ @code { - private List<GenericRoom> Rooms { get; set; } - private ProfileResponse GlobalProfile { get; set; } - + private List<RoomInfo> Rooms { get; set; } + private ProfileResponseEventData 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(); + Rooms = (await hs.GetJoinedRooms()).Select(x => new RoomInfo() { Room = x }).ToList(); await base.OnInitializedAsync(); } |