about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-11 20:56:16 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-11 20:56:16 +0200
commita069cfd6a0f7c53b902607e79037ffd90681a7b9 (patch)
tree0cfc47619d35e2d89568f5d1c151ba8e1906ec85 /MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs
parentAdd license, deploy src (diff)
downloadMatrixUtils-a069cfd6a0f7c53b902607e79037ffd90681a7b9.tar.xz
Add state cache
Diffstat (limited to 'MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs')
-rw-r--r--MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs2
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