diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-05-03 20:42:20 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-05-03 20:42:20 +0200 |
commit | b02fb81a56bd94b38fdb26771c3e591419f0f49c (patch) | |
tree | 617538d36ff9be9ba0f5d13cb6076b02f017a91b /MatrixRoomUtils.Web/Pages/RoomStateViewerPage.razor | |
parent | Refactor (diff) | |
download | MatrixUtils-b02fb81a56bd94b38fdb26771c3e591419f0f49c.tar.xz |
Small refactoring
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/RoomStateViewerPage.razor')
-rw-r--r-- | MatrixRoomUtils.Web/Pages/RoomStateViewerPage.razor | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/MatrixRoomUtils.Web/Pages/RoomStateViewerPage.razor b/MatrixRoomUtils.Web/Pages/RoomStateViewerPage.razor index 8c33d89..72c5efa 100644 --- a/MatrixRoomUtils.Web/Pages/RoomStateViewerPage.razor +++ b/MatrixRoomUtils.Web/Pages/RoomStateViewerPage.razor @@ -1,13 +1,7 @@ @page "/RoomStateViewer/{RoomId}" -@using MatrixRoomUtils.Authentication -@using MatrixRoomUtils.Web.Classes -@using Blazored.LocalStorage @using System.Net.Http.Headers @using System.Text.Json -@using System.Xml.Schema @using MatrixRoomUtils.Extensions -@using MatrixRoomUtils.StateEventTypes -@using MatrixRoomUtils.Web.Shared.IndexComponents @inject ILocalStorageService LocalStorage @inject NavigationManager NavigationManager <h3>Room state viewer</h3> @@ -80,9 +74,9 @@ protected override async Task OnInitializedAsync() { - if (!LocalStorageWrapper.WasLoaded) await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage); + if (!RuntimeCache.WasLoaded) await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage); await base.OnInitializedAsync(); - if (LocalStorageWrapper.AccessToken == null || LocalStorageWrapper.CurrentHomeserver == null) + if (RuntimeCache.AccessToken == null || RuntimeCache.CurrentHomeserver == null) { NavigationManager.NavigateTo("/Login"); return; @@ -97,8 +91,8 @@ { int StateLoaded = 0; using var client = new HttpClient(); - client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", LocalStorageWrapper.AccessToken); - var response = await client.GetAsync($"{LocalStorageWrapper.CurrentHomeserver}/_matrix/client/r0/rooms/{RoomId}/state"); + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", RuntimeCache.AccessToken); + var response = await client.GetAsync($"{RuntimeCache.CurrentHomeserver}/_matrix/client/r0/rooms/{RoomId}/state"); // var response = await client.GetAsync($"http://localhost:5117/matrix-hq-state.json"); //var _events = await response.Content.ReadFromJsonAsync<Queue<StateEventStruct>>(); var _data = await response.Content.ReadAsStreamAsync(); |