about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Pages/Index.razor
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-10-17 17:11:49 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-10-17 17:11:49 +0200
commitc5c3c3506ec10e373d5c0ebb15146e4ed4e36df5 (patch)
treee74107e266ced599100d43c4e5c0823d4292dfdd /MatrixRoomUtils.Web/Pages/Index.razor
parentRefactors (diff)
downloadMatrixUtils-c5c3c3506ec10e373d5c0ebb15146e4ed4e36df5.tar.xz
Add profile management page
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/Index.razor')
-rw-r--r--MatrixRoomUtils.Web/Pages/Index.razor12
1 files changed, 7 insertions, 5 deletions
diff --git a/MatrixRoomUtils.Web/Pages/Index.razor b/MatrixRoomUtils.Web/Pages/Index.razor
index 845bbb9..834c373 100644
--- a/MatrixRoomUtils.Web/Pages/Index.razor
+++ b/MatrixRoomUtils.Web/Pages/Index.razor
@@ -36,7 +36,7 @@ Small collection of tools to do not-so-everyday things.
                 </td>
                 <td>
                     <p>
-                        <LinkButton href="">Manage</LinkButton>
+                        <LinkButton OnClick="@(()=>ManageUser(_auth))">Manage</LinkButton>
                         <LinkButton OnClick="@(() => RemoveUser(_auth))">Remove</LinkButton>
                         <LinkButton OnClick="@(() => RemoveUser(_auth, true))">Log out</LinkButton>
                     </p>
@@ -72,10 +72,7 @@ Small collection of tools to do not-so-everyday things.
             var profile = await hs.GetProfileAsync(hs.WhoAmI.UserId);
             userInfo.DisplayName = profile.DisplayName ?? hs.WhoAmI.UserId;
             Console.WriteLine(profile.ToJson());
-            userInfo.AvatarUrl = await hsResolver.ResolveMediaUri(hs.FullHomeServerDomain,
-                profile.AvatarUrl
-                ?? "https://api.dicebear.com/6.x/identicon/svg?seed=" + hs.WhoAmI.UserId
-                );
+            userInfo.AvatarUrl = string.IsNullOrWhiteSpace(profile.AvatarUrl) ? "https://api.dicebear.com/6.x/identicon/svg?seed=" + hs.WhoAmI.UserId : hs.ResolveMediaUri(profile.AvatarUrl);
             userInfo.RoomCount = (await roomCountTask).Count;
             _users.Add(token, userInfo);
     // StateHasChanged();
@@ -116,4 +113,9 @@ Small collection of tools to do not-so-everyday things.
         await MRUStorage.SetCurrentToken(auth);
         await OnInitializedAsync();
     }
+
+    private async Task ManageUser(UserAuth auth) {
+        await SwitchSession(auth);
+        NavigationManager.NavigateTo("/User/Manage");
+    }
 }