From 3e6a73599bb58161c08d8675ea23ee6c82c6675c Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 29 Jan 2024 10:15:27 +0100 Subject: Room list fixes, migration fix, update available handler --- .../Shared/RoomListComponents/RoomListSpace.razor | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'MatrixUtils.Web/Shared/RoomListComponents/RoomListSpace.razor') diff --git a/MatrixUtils.Web/Shared/RoomListComponents/RoomListSpace.razor b/MatrixUtils.Web/Shared/RoomListComponents/RoomListSpace.razor index 895d642..9c481e3 100644 --- a/MatrixUtils.Web/Shared/RoomListComponents/RoomListSpace.razor +++ b/MatrixUtils.Web/Shared/RoomListComponents/RoomListSpace.razor @@ -1,15 +1,23 @@ @using System.Collections.ObjectModel @using MatrixUtils.Abstractions -Manage space +Manage space
@Children.Count children @if (_shouldRenderChildren) {

Breadcrumb: @Breadcrumbs

+

Joined:

+

Unjoined:

+ @foreach (var room in Unjoined) { +

@room.Room.RoomId

+ } + @*
*@ + @* *@ + @*
*@ }
@@ -28,11 +36,14 @@ } private ObservableCollection Children { get; set; } = new(); + private Collection Unjoined { get; set; } = new(); protected override async Task OnInitializedAsync() { if (Breadcrumbs == null) throw new ArgumentNullException(nameof(Breadcrumbs)); await Task.Delay(Random.Shared.Next(1000, 10000)); var rooms = Space.Room.AsSpace.GetChildrenAsync(); + var hs = await RMUStorage.GetCurrentSessionOrNavigate(); + var joinedRooms = await hs.GetJoinedRooms(); await foreach (var room in rooms) { if (Breadcrumbs.Contains(room.RoomId)) continue; var roomInfo = KnownRooms.FirstOrDefault(x => x.Room.RoomId == room.RoomId); @@ -42,7 +53,9 @@ }; KnownRooms.Add(roomInfo); } - Children.Add(roomInfo); + if(joinedRooms.Any(x=>x.RoomId == room.RoomId)) + Children.Add(roomInfo); + else Unjoined.Add(roomInfo); } await base.OnInitializedAsync(); } -- cgit 1.4.1