about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-06-19 02:36:32 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-06-19 02:36:32 +0200
commited2205972a7b7d6fdd4563c3775a83616920597a (patch)
tree54aec1cfdf861fd8a7739be131fbe79ae24d91e4 /MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs
parentPartial refactor (diff)
downloadMatrixUtils-ed2205972a7b7d6fdd4563c3775a83616920597a.tar.xz
Working sync
Diffstat (limited to 'MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs')
-rw-r--r--MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs17
1 files changed, 8 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");
         }
     }