From bb8c2637af3b7982e7a4b2fd15e2fbec613d0848 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Fri, 30 Jun 2023 03:36:58 +0200 Subject: Todays progress --- MatrixRoomUtils.Web/Shared/UserListItem.razor | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'MatrixRoomUtils.Web/Shared/UserListItem.razor') diff --git a/MatrixRoomUtils.Web/Shared/UserListItem.razor b/MatrixRoomUtils.Web/Shared/UserListItem.razor index 9b3cff1..a41ce49 100644 --- a/MatrixRoomUtils.Web/Shared/UserListItem.razor +++ b/MatrixRoomUtils.Web/Shared/UserListItem.razor @@ -1,11 +1,12 @@ @using MatrixRoomUtils.Core.Responses @using MatrixRoomUtils.Core.StateEventTypes +@using MatrixRoomUtils.Core.Helpers
- + @profileName
- @if (ChildContent != null) { + @if (ChildContent is not null) { @ChildContent }
@@ -30,24 +31,24 @@ protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); - await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage); + var hs = await MRUStorage.GetCurrentSessionOrNavigate(); + if (hs is null) return; + await _semaphoreSlim.WaitAsync(); if (User == null) { if (UserId == null) { throw new ArgumentNullException(nameof(UserId)); } - User = await RuntimeCache.CurrentHomeServer.GetProfile(UserId); + User = await hs.GetProfile(UserId); } // UserId = User.; - profileAvatar = RuntimeCache.CurrentHomeServer.ResolveMediaUri(User.AvatarUrl); + profileAvatar = MediaResolver.ResolveMediaUri(hs.FullHomeServerDomain, User.AvatarUrl); profileName = User.DisplayName; _semaphoreSlim.Release(); - if (Random.Shared.Next(100) == 1) - await LocalStorageWrapper.SaveCacheToLocalStorage(LocalStorage); } } \ No newline at end of file -- cgit 1.4.1