about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Classes
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Web/Classes')
-rw-r--r--MatrixRoomUtils.Web/Classes/LocalStorageProviderService.cs5
-rw-r--r--MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs10
2 files changed, 11 insertions, 4 deletions
diff --git a/MatrixRoomUtils.Web/Classes/LocalStorageProviderService.cs b/MatrixRoomUtils.Web/Classes/LocalStorageProviderService.cs
new file mode 100644
index 0000000..0c3deec
--- /dev/null
+++ b/MatrixRoomUtils.Web/Classes/LocalStorageProviderService.cs
@@ -0,0 +1,5 @@
+namespace MatrixRoomUtils.Web.Classes; 
+
+public class LocalStorageProviderService : IStorageProvider {
+    
+}
\ No newline at end of file
diff --git a/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs b/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs
index 4e7117d..b7da78a 100644
--- a/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs
+++ b/MatrixRoomUtils.Web/Classes/LocalStorageWrapper.cs
@@ -10,11 +10,13 @@ public class LocalStorageWrapper {
     //some basic logic
     public static async Task InitialiseRuntimeVariables(ILocalStorageService localStorage) {
         //RuntimeCache stuff
-        async void Save() => await SaveToLocalStorage(localStorage);
-
+        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 = async (key, obj) => await localStorage.SetItemAsync(key, obj);
-        RuntimeCache.RemoveObject = async key => await localStorage.RemoveItemAsync(key);
+        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");