diff options
Diffstat (limited to 'MatrixRoomUtils.Web/Classes')
-rw-r--r-- | MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs | 17 | ||||
-rw-r--r-- | MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs | 12 |
2 files changed, 20 insertions, 9 deletions
diff --git a/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs b/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs index b7da78a..878eca4 100644 --- a/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs +++ b/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs @@ -10,19 +10,18 @@ public class LocalStorageWrapper { //some basic logic public static async Task InitialiseRuntimeVariables(ILocalStorageService localStorage) { //RuntimeCache stuff - async Task Save() => await SaveToLocalStorage(localStorage); - async Task SaveObject(string key, object obj) => await localStorage.SetItemAsync(key, obj); - async Task RemoveObject(string key) => await localStorage.RemoveItemAsync(key); - - RuntimeCache.Save = Save; - RuntimeCache.SaveObject = SaveObject; - RuntimeCache.RemoveObject = RemoveObject; + // async Task Save() => await SaveToLocalStorage(localStorage); + // async Task SaveObject(string key, object obj) => await localStorage.SetItemAsync(key, obj); + // async Task RemoveObject(string key) => await localStorage.RemoveItemAsync(key); + // + // RuntimeCache.Save = Save; + // RuntimeCache.SaveObject = SaveObject; + // RuntimeCache.RemoveObject = RemoveObject; if (RuntimeCache.LastUsedToken != null) { Console.WriteLine("Access token is not null, creating authenticated home server"); Console.WriteLine($"Homeserver cache: {RuntimeCache.HomeserverResolutionCache.Count} entries"); // Console.WriteLine(RuntimeCache.HomeserverResolutionCache.ToJson()); - RuntimeCache.CurrentHomeServer = await new AuthenticatedHomeServer(RuntimeCache.LoginSessions[RuntimeCache.LastUsedToken].LoginResponse.UserId, RuntimeCache.LastUsedToken, - RuntimeCache.LoginSessions[RuntimeCache.LastUsedToken].LoginResponse.HomeServer).Configure(); + RuntimeCache.CurrentHomeServer = await new AuthenticatedHomeServer(RuntimeCache.LoginSessions[RuntimeCache.LastUsedToken].LoginResponse.HomeServer, RuntimeCache.LastUsedToken, TODO).Configure(); Console.WriteLine("Created authenticated home server"); } } diff --git a/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs b/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs new file mode 100644 index 0000000..4a9c7d1 --- /dev/null +++ b/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs @@ -0,0 +1,12 @@ +using Blazored.SessionStorage; +using MatrixRoomUtils.Core.Interfaces.Services; + +namespace MatrixRoomUtils.Web; + +public class SessionStorageProviderService : IStorageProvider { + private readonly ISessionStorageService _sessionStorage; + + public SessionStorageProviderService(ISessionStorageService sessionStorage) { + _sessionStorage = sessionStorage; + } +} \ No newline at end of file |