@using MatrixRoomUtils.Authentication @using MatrixRoomUtils.Web.Classes @using System.Text.Json @using Blazored.LocalStorage @using MatrixRoomUtils.Extensions @using Index = MatrixRoomUtils.Web.Pages.Index @inject ILocalStorageService LocalStorage @inject NavigationManager NavigationManager
@User.Profile.DisplayName on @User.LoginResponse.HomeServer Remove
@code { [Parameter] public UserInfo User { get; set; } private string _avatarUrl { get; set; } private bool _removed { get; set; } = false; protected override async Task OnInitializedAsync() { if(User.Profile.AvatarUrl != null && User.Profile.AvatarUrl != "") _avatarUrl = await User.Profile.AvatarUrl.GetMediaUrl(); else _avatarUrl = "https://api.dicebear.com/6.x/identicon/svg?seed=" + User.LoginResponse.UserId; await base.OnInitializedAsync(); } private async Task RemoveUser() { RuntimeCache.LoginSessions.Remove(User.AccessToken); await LocalStorageWrapper.ReloadLocalStorage(LocalStorage); _removed = true; StateHasChanged(); } private async Task SetCurrent() { RuntimeCache.AccessToken = User.AccessToken; //RuntimeCache.CurrentHomeserver = await MatrixAuth.ResolveHomeserverFromWellKnown(LocalStorageWrapper.LoginSessions[Token].LoginResponse.HomeServer); await LocalStorageWrapper.ReloadLocalStorage(LocalStorage); StateHasChanged(); } }