diff options
Diffstat (limited to 'MatrixRoomUtils.Web/Shared')
-rw-r--r-- | MatrixRoomUtils.Web/Shared/MxcImage.razor | 12 |
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] |