about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Classes
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
parentPartial refactor (diff)
downloadMatrixUtils-ed2205972a7b7d6fdd4563c3775a83616920597a.tar.xz
Working sync
Diffstat (limited to 'MatrixRoomUtils.Web/Classes')
-rw-r--r--MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs17
-rw-r--r--MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs12
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