about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Rooms/Index.razor
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-02-23 13:57:06 +0100
committerRory& <root@rory.gay>2024-02-23 13:57:06 +0100
commitd0d11db2209a8be65c27e15ca9d8a3b594f1a352 (patch)
treeb42b7de4b09888a1439d0939707ba1331becf626 /MatrixUtils.Web/Pages/Rooms/Index.razor
parentHS emulator (diff)
downloadMatrixUtils-d0d11db2209a8be65c27e15ca9d8a3b594f1a352.tar.xz
Add eons of work because I forgot to push
Diffstat (limited to 'MatrixUtils.Web/Pages/Rooms/Index.razor')
-rw-r--r--MatrixUtils.Web/Pages/Rooms/Index.razor16
1 files changed, 7 insertions, 9 deletions
diff --git a/MatrixUtils.Web/Pages/Rooms/Index.razor b/MatrixUtils.Web/Pages/Rooms/Index.razor
index 1813908..d7a3569 100644
--- a/MatrixUtils.Web/Pages/Rooms/Index.razor
+++ b/MatrixUtils.Web/Pages/Rooms/Index.razor
@@ -69,14 +69,14 @@
     protected override async Task OnInitializedAsync() {
         Homeserver = await RMUStorage.GetCurrentSessionOrNavigate();
         if (Homeserver is null) return;
-        var rooms = await Homeserver.GetJoinedRooms();
+        // var rooms = await Homeserver.GetJoinedRooms();
         // SemaphoreSlim _semaphore = new(160, 160);
         GlobalProfile = await Homeserver.GetProfileAsync(Homeserver.WhoAmI.UserId);
 
         var filter = await Homeserver.GetOrUploadNamedFilterIdAsync(CommonSyncFilters.GetBasicRoomInfo);
         var filterData = await Homeserver.GetFilterAsync(filter);
         
-        Rooms = new ObservableCollection<RoomInfo>(rooms.Select(x => new RoomInfo() { Room = x }));
+        // Rooms = new ObservableCollection<RoomInfo>(rooms.Select(room => new RoomInfo(room)));
         // foreach (var stateType in filterData.Room?.State?.Types ?? []) {
         //     var tasks = Rooms.Select(async room => {
         //         try {
@@ -126,7 +126,7 @@
 
                 Console.WriteLine($"Queue no longer empty after {renderTimeSw.Elapsed}!");
 
-                int maxUpdates = 50;
+                int maxUpdates = 50000;
                 isInitialSync = false;
                 while (maxUpdates-- > 0 && queue.TryDequeue(out var queueEntry)) {
                     var (roomId, roomData) = queueEntry;
@@ -139,9 +139,7 @@
                     }
                     else {
                         Console.WriteLine($"QueueWorker: encountered new room {roomId}!");
-                        room = new RoomInfo() {
-                            Room = Homeserver.GetRoom(roomId)
-                        };
+                        room = new RoomInfo(Homeserver.GetRoom(roomId), roomData.State?.Events);
                         Rooms.Add(room);
                     }
 
@@ -156,14 +154,14 @@
                         Console.WriteLine($"QueueWorker: could not merge state for {room.Room.RoomId} as new data contains no state events!");
                     }
 
-                    await Task.Delay(100);
+                    // await Task.Delay(100);
                 }
 
                 Console.WriteLine($"QueueWorker: {queue.Count} entries left in queue, {maxUpdates} maxUpdates left, RenderContents: {RenderContents}");
                 Status = $"Got {Rooms.Count} rooms so far! {queue.Count} entries in processing queue...";
 
-                RenderContents |= queue.Count == 0;
-                await Task.Delay(Rooms.Count);
+                // RenderContents |= queue.Count == 0;
+                // await Task.Delay(Rooms.Count);
             }
             catch (Exception e) {
                 Console.WriteLine("QueueWorker exception: " + e);