From 7978f08235ceca22eacae11a88a7703513238cb3 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 1 Jul 2023 20:51:15 +0200 Subject: Deduplicate some api calls --- .../Shared/RoomListComponents/RoomListCategory.razor | 6 ++++++ .../Shared/RoomListComponents/RoomListPolicyRoom.razor | 12 ++++++++++++ .../Shared/RoomListComponents/RoomListSpace.razor | 7 ++++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListPolicyRoom.razor (limited to 'MatrixRoomUtils.Web/Shared/RoomListComponents') diff --git a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor index a7e9399..e860321 100644 --- a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor +++ b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor @@ -1,9 +1,12 @@ +@using MatrixRoomUtils.Core.StateEventTypes
@roomType (@rooms.Count) @foreach (var room in rooms) {
View timeline + View state + Edit state @if (roomType == "Space") { @@ -17,6 +20,9 @@ [Parameter] public KeyValuePair> Category { get; set; } + + [Parameter] + public ProfileResponse? GlobalProfile { get; set; } private string roomType => Category.Key; private List rooms => Category.Value; diff --git a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListPolicyRoom.razor b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListPolicyRoom.razor new file mode 100644 index 0000000..f05ac7b --- /dev/null +++ b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListPolicyRoom.razor @@ -0,0 +1,12 @@ +Manage policies + +@code { + + [Parameter] + public GenericRoom Room { get; set; } + + protected override async Task OnInitializedAsync() { + await base.OnInitializedAsync(); + } + +} \ No newline at end of file diff --git a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListSpace.razor b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListSpace.razor index 5d106c3..73dc334 100644 --- a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListSpace.razor +++ b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListSpace.razor @@ -26,7 +26,12 @@ protected override async Task OnInitializedAsync() { if (Breadcrumbs == null) throw new ArgumentNullException(nameof(Breadcrumbs)); - Children = (await Space.AsSpace.GetRoomsAsync()).Where(x => !Breadcrumbs.Contains(x.RoomId)).ToList(); + await Task.Delay(Random.Shared.Next(1000, 10000)); + var rooms = Space.AsSpace.GetRoomsAsync(); + await foreach (var room in rooms) { + if(Breadcrumbs.Contains(room.RoomId)) continue; + Children.Add(room); + } await base.OnInitializedAsync(); } -- cgit 1.5.1