diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-30 03:36:58 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-30 03:36:58 +0200 |
commit | bb8c2637af3b7982e7a4b2fd15e2fbec613d0848 (patch) | |
tree | b8075ba7e507aad3f96f354712ad920ac421e474 /MatrixRoomUtils.Web/Pages/DebugTools.razor | |
parent | Update stuff (diff) | |
download | MatrixUtils-bb8c2637af3b7982e7a4b2fd15e2fbec613d0848.tar.xz |
Todays progress
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/DebugTools.razor')
-rw-r--r-- | MatrixRoomUtils.Web/Pages/DebugTools.razor | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/MatrixRoomUtils.Web/Pages/DebugTools.razor b/MatrixRoomUtils.Web/Pages/DebugTools.razor index 4e4cec8..5116754 100644 --- a/MatrixRoomUtils.Web/Pages/DebugTools.razor +++ b/MatrixRoomUtils.Web/Pages/DebugTools.razor @@ -37,13 +37,10 @@ else { public List<string> Rooms { get; set; } = new(); protected override async Task OnInitializedAsync() { - await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage); await base.OnInitializedAsync(); - if (RuntimeCache.CurrentHomeServer == null) { - NavigationManager.NavigateTo("/Login"); - return; - } - Rooms = (await RuntimeCache.CurrentHomeServer.GetJoinedRooms()).Select(x => x.RoomId).ToList(); + var hs = await MRUStorage.GetCurrentSessionOrNavigate(); + if (hs == null) return; + Rooms = (await hs.GetJoinedRooms()).Select(x => x.RoomId).ToList(); Console.WriteLine("Fetched joined rooms!"); } @@ -53,7 +50,9 @@ else { private async Task SendGetRequest() { var field = typeof(IHomeServer).GetRuntimeFields().First(x => x.ToString().Contains("<_httpClient>k__BackingField")); - var httpClient = field.GetValue(RuntimeCache.CurrentHomeServer) as HttpClient; + var hs = await MRUStorage.GetCurrentSessionOrNavigate(); + if (hs == null) return; + var httpClient = field.GetValue(hs) as MatrixHttpClient; try { var res = await httpClient.GetAsync(get_request_url); if (res.IsSuccessStatusCode) { |