about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--MatrixRoomUtils.Web/Pages/Rooms/Index.razor2
-rw-r--r--MatrixRoomUtils.Web/Shared/MxcImage.razor12
2 files changed, 12 insertions, 2 deletions
diff --git a/MatrixRoomUtils.Web/Pages/Rooms/Index.razor b/MatrixRoomUtils.Web/Pages/Rooms/Index.razor
index fb44337..2ac4bcb 100644
--- a/MatrixRoomUtils.Web/Pages/Rooms/Index.razor
+++ b/MatrixRoomUtils.Web/Pages/Rooms/Index.razor
@@ -161,7 +161,7 @@
                     }
                     RenderContents |= queue.Count == 0;
                     if (queue.Count > 10) RenderContents = false;
-                    await Task.Delay(RenderContents ? 25 : 12);
+                    await Task.Delay(RenderContents ? 25 : 6);
                 }
                 // else {
                     // Console.WriteLine("Failed to dequeue item");
diff --git a/MatrixRoomUtils.Web/Shared/MxcImage.razor b/MatrixRoomUtils.Web/Shared/MxcImage.razor
index f54c1f8..fb8c248 100644
--- a/MatrixRoomUtils.Web/Shared/MxcImage.razor
+++ b/MatrixRoomUtils.Web/Shared/MxcImage.razor
@@ -8,11 +8,15 @@
     public string MxcUri {
         get => _mxcUri ?? "";
         set {
+            Console.WriteLine($"New MXC uri: {value}");
             _mxcUri = value;
             UriHasChanged(value);
         }
     }
     
+    //mxcuri binding
+    
+    
     [Parameter]
     public string Style {
         get => _style;
@@ -34,7 +38,13 @@
 
     private async Task UriHasChanged(string value) {
         var uri = value[5..].Split('/');
-        ResolvedUri = (Homeserver ?? await hsProvider.GetRemoteHomeserver(uri[0])).ResolveMediaUri(value);
+        Console.WriteLine($"UriHasChanged: {value} {uri[0]}");
+        if (Homeserver is null) {
+            Console.WriteLine($"Homeserver is null, creating new remotehomeserver for {uri[0]}");
+            Homeserver = await hsProvider.GetRemoteHomeserver(uri[0]);
+        }
+        ResolvedUri = Homeserver.ResolveMediaUri(value);
+        Console.WriteLine($"ResolvedUri: {ResolvedUri}");
     }
 
     [Parameter]