diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-05-11 20:56:16 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-05-11 20:56:16 +0200 |
commit | a069cfd6a0f7c53b902607e79037ffd90681a7b9 (patch) | |
tree | 0cfc47619d35e2d89568f5d1c151ba8e1906ec85 /MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs | |
parent | Add license, deploy src (diff) | |
download | MatrixUtils-a069cfd6a0f7c53b902607e79037ffd90681a7b9.tar.xz |
Add state cache
Diffstat (limited to 'MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs')
-rw-r--r-- | MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs b/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs index 5a13c49..287d1e5 100644 --- a/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs +++ b/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs @@ -28,6 +28,7 @@ public partial class LocalStorageWrapper RuntimeCache.CurrentHomeServer = await new AuthenticatedHomeServer(RuntimeCache.LoginSessions[RuntimeCache.LastUsedToken].LoginResponse.UserId, RuntimeCache.LastUsedToken, RuntimeCache.LoginSessions[RuntimeCache.LastUsedToken].LoginResponse.HomeServer).Configure(); Console.WriteLine("Created authenticated home server"); } + RuntimeCache.GenericResponseCache = await localStorage.GetItemAsync<Dictionary<string, ObjectCache<object>>>("rory.matrixroomutils.generic_cache") ?? new(); RuntimeCache.WasLoaded = true; } @@ -40,5 +41,6 @@ public partial class LocalStorageWrapper await localStorage.SetItemAsync("rory.matrixroomutils.homeserver_resolution_cache", RuntimeCache.HomeserverResolutionCache.DistinctBy(x => x.Key) .ToDictionary(x => x.Key, x => x.Value)); + await localStorage.SetItemAsync("rory.matrixroomutils.generic_cache", RuntimeCache.GenericResponseCache); } } \ No newline at end of file |