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/Shared/RoomListComponents/RoomListCategory.razor | |
parent | Deduplicate some api calls (diff) | |
download | MatrixUtils-def33cc092ae2c6defcc218b108b7c99cbfb8581.tar.xz |
Prefetch room info
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor')
-rw-r--r-- | MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor index e860321..4be3c1f 100644 --- a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor +++ b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor @@ -1,12 +1,16 @@ @using MatrixRoomUtils.Core.StateEventTypes +@using MatrixRoomUtils.Core.StateEventTypes.Spec <details> <summary>@roomType (@rooms.Count)</summary> @foreach (var room in rooms) { <div class="room-list-item"> - <RoomListItem Room="@room" ShowOwnProfile="@(roomType == "Room")"></RoomListItem> - <MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton href="@($"/Rooms/{room.RoomId}/Timeline")">View timeline</MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton> - <MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton href="@($"/Rooms/{room.RoomId}/State/View")">View state</MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton> - <MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton href="@($"/Rooms/{room.RoomId}/State/Edit")">Edit state</MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton> + <RoomListItem RoomInfo="@room" ShowOwnProfile="@(roomType == "Room")"></RoomListItem> + @if (room.StateEvents.Any(x => x.Type == "m.room.create")) { + + } + <MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton href="@($"/Rooms/{room.Room.RoomId}/Timeline")">View timeline</MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton> + <MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton href="@($"/Rooms/{room.Room.RoomId}/State/View")">View state</MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton> + <MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton href="@($"/Rooms/{room.Room.RoomId}/State/Edit")">Edit state</MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton> @if (roomType == "Space") { <RoomListSpace Space="@room"></RoomListSpace> @@ -19,12 +23,12 @@ @code { [Parameter] - public KeyValuePair<string, List<GenericRoom>> Category { get; set; } + public KeyValuePair<string, List<RoomInfo>> Category { get; set; } [Parameter] - public ProfileResponse? GlobalProfile { get; set; } + public ProfileResponseEventData? GlobalProfile { get; set; } private string roomType => Category.Key; - private List<GenericRoom> rooms => Category.Value; + private List<RoomInfo> rooms => Category.Value; } \ No newline at end of file |