From a069cfd6a0f7c53b902607e79037ffd90681a7b9 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Thu, 11 May 2023 20:56:16 +0200 Subject: Add state cache --- MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs') 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>>("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 -- cgit 1.4.1