about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Shared/RoomListItem.razor
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/RoomListItem.razor')
-rw-r--r--MatrixRoomUtils.Web/Shared/RoomListItem.razor10
1 files changed, 9 insertions, 1 deletions
diff --git a/MatrixRoomUtils.Web/Shared/RoomListItem.razor b/MatrixRoomUtils.Web/Shared/RoomListItem.razor
index d2c844d..15ca5c0 100644
--- a/MatrixRoomUtils.Web/Shared/RoomListItem.razor
+++ b/MatrixRoomUtils.Web/Shared/RoomListItem.razor
@@ -33,6 +33,12 @@
     protected override async Task OnInitializedAsync()
     {
         await base.OnInitializedAsync();
+        
+        if(!RuntimeCache.WasLoaded) {
+            Console.WriteLine("Loading from local storage");
+            await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage);
+        }
+
         if (Room == null)
         {
             if (RoomId == null)
@@ -80,7 +86,7 @@
                 {
                     hasCustomProfileName = _name.GetString() != profile.DisplayName;
                     profileName = _name.GetString();
-                    Console.WriteLine($"{profile.DisplayName} - {_name.GetString()}: {hasCustomProfileName}");
+                    // Console.WriteLine($"{profile.DisplayName} - {_name.GetString()}: {hasCustomProfileName}");
                 }
                 else
                 {
@@ -88,6 +94,8 @@
                 }
             }
         }
+        if(Random.Shared.Next(100) == 1)
+            await LocalStorageWrapper.SaveToLocalStorage(LocalStorage);
     }
 
 }
\ No newline at end of file