Add profile management page
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");
+ }
}
|