about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Rooms
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-02-18 07:41:20 +0100
committerRory& <root@rory.gay>2025-02-18 07:41:20 +0100
commit373e3a481e9b16b328002426d416344a87ef1058 (patch)
tree17b50a14479099eba4b2ab490ffd5b28cd12c440 /MatrixUtils.Web/Pages/Rooms
parentVarious changes (diff)
downloadMatrixUtils-373e3a481e9b16b328002426d416344a87ef1058.tar.xz
Some cleanup
Diffstat (limited to 'MatrixUtils.Web/Pages/Rooms')
-rw-r--r--MatrixUtils.Web/Pages/Rooms/Index.razor22
-rw-r--r--MatrixUtils.Web/Pages/Rooms/PolicyList.razor2
-rw-r--r--MatrixUtils.Web/Pages/Rooms/PolicyList2.razor2
3 files changed, 15 insertions, 11 deletions
diff --git a/MatrixUtils.Web/Pages/Rooms/Index.razor b/MatrixUtils.Web/Pages/Rooms/Index.razor

index 5dd8189..45219c7 100644 --- a/MatrixUtils.Web/Pages/Rooms/Index.razor +++ b/MatrixUtils.Web/Pages/Rooms/Index.razor
@@ -13,9 +13,7 @@ <p>@Status2</p> <LinkButton href="/Rooms/Create">Create new room</LinkButton> -<CascadingValue TValue="AuthenticatedHomeserverGeneric" Value="Homeserver"> - <RoomList Rooms="Rooms" GlobalProfile="@GlobalProfile" @bind-StillFetching="RenderContents"></RoomList> -</CascadingValue> +<RoomList Rooms="Rooms" GlobalProfile="@GlobalProfile" @bind-StillFetching="RenderContents" Homeserver="@Homeserver"></RoomList> @code { @@ -122,7 +120,7 @@ try { while (queue.Count == 0) { Console.WriteLine("Queue is empty, waiting..."); - await Task.Delay(isInitialSync ? 100 : 2500); + await Task.Delay(isInitialSync ? 1000 : 2500); } Console.WriteLine($"Queue no longer empty after {renderTimeSw.Elapsed}!"); @@ -131,15 +129,15 @@ isInitialSync = false; while (maxUpdates-- > 0 && queue.TryDequeue(out var queueEntry)) { var (roomId, roomData) = queueEntry; - Console.WriteLine($"Dequeued room {roomId}"); + // Console.WriteLine($"Dequeued room {roomId}"); RoomInfo room; if (Rooms.Any(x => x.Room.RoomId == roomId)) { room = Rooms.First(x => x.Room.RoomId == roomId); - Console.WriteLine($"QueueWorker: {roomId} already known with {room.StateEvents?.Count ?? 0} state events"); + // Console.WriteLine($"QueueWorker: {roomId} already known with {room.StateEvents?.Count ?? 0} state events"); } else { - Console.WriteLine($"QueueWorker: encountered new room {roomId}!"); + // Console.WriteLine($"QueueWorker: encountered new room {roomId}!"); room = new RoomInfo(Homeserver.GetRoom(roomId), roomData.State?.Events); Rooms.Add(room); } @@ -155,6 +153,11 @@ Console.WriteLine($"QueueWorker: could not merge state for {room.Room.RoomId} as new data contains no state events!"); } + if (maxUpdates % 100 == 0) { + Console.WriteLine($"QueueWorker: {queue.Count} entries left in queue, {maxUpdates} maxUpdates left, RenderContents: {RenderContents}"); + StateHasChanged(); + await Task.Yield(); + } // await Task.Delay(100); } @@ -225,9 +228,10 @@ Rooms.Remove(Rooms.First(x => x.Room.RoomId == leftRoom.Key)); Status = $"Got {Rooms.Count} rooms so far! {queue.Count} entries in processing queue... " + - $"{sync?.Rooms?.Join?.Count ?? 0} new updates!"; + $"{sync.Rooms?.Join?.Count ?? 0} new updates!"; - Status2 = $"Next batch: {sync.NextBatch}"; + Status2 = $"Next batch: {sync?.NextBatch}"; + await Task.Yield(); } } diff --git a/MatrixUtils.Web/Pages/Rooms/PolicyList.razor b/MatrixUtils.Web/Pages/Rooms/PolicyList.razor
index 94113dd..3d78f4a 100644 --- a/MatrixUtils.Web/Pages/Rooms/PolicyList.razor +++ b/MatrixUtils.Web/Pages/Rooms/PolicyList.razor
@@ -171,7 +171,7 @@ else { private bool Loading { get; set; } = true; [Parameter] - public string RoomId { get; set; } = null!; + public string RoomId { get; set; } private bool _enableAvatars; private StateEventResponse? _currentlyEditingEvent; diff --git a/MatrixUtils.Web/Pages/Rooms/PolicyList2.razor b/MatrixUtils.Web/Pages/Rooms/PolicyList2.razor
index 50f304a..664551a 100644 --- a/MatrixUtils.Web/Pages/Rooms/PolicyList2.razor +++ b/MatrixUtils.Web/Pages/Rooms/PolicyList2.razor
@@ -141,7 +141,7 @@ else { private bool Loading { get; set; } = true; [Parameter] - public string RoomId { get; set; } = null!; + public string RoomId { get; set; } private bool _enableAvatars; private StateEventResponse? _currentlyEditingEvent;