about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Shared/MxcImage.razor
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-12-14 19:08:22 +0000
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-12-14 19:08:22 +0000
commit46f6d337c765f1f8a91b9422f487c32d5e1cf56b (patch)
tree59e69e21ff1016d27ba8a23fb01435fa27ca9ed1 /MatrixRoomUtils.Web/Shared/MxcImage.razor
parentCleanup (diff)
downloadMatrixUtils-46f6d337c765f1f8a91b9422f487c32d5e1cf56b.tar.xz
Small changes
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/MxcImage.razor')
-rw-r--r--MatrixRoomUtils.Web/Shared/MxcImage.razor12
1 files changed, 11 insertions, 1 deletions
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]