diff options
Diffstat (limited to 'MatrixRoomUtils.Web/Classes')
5 files changed, 16 insertions, 17 deletions
diff --git a/MatrixRoomUtils.Web/Classes/LocalStorageProviderService.cs b/MatrixRoomUtils.Web/Classes/LocalStorageProviderService.cs index 02d691a..51aee12 100644 --- a/MatrixRoomUtils.Web/Classes/LocalStorageProviderService.cs +++ b/MatrixRoomUtils.Web/Classes/LocalStorageProviderService.cs @@ -10,9 +10,11 @@ public class LocalStorageProviderService : IStorageProvider { _localStorageService = localStorageService; } - async Task IStorageProvider.SaveAllChildrenAsync<T>(string key, T value) => throw new NotImplementedException(); + Task IStorageProvider.SaveAllChildrenAsync<T>(string key, T value) { + throw new NotImplementedException(); + } - async Task<T?> IStorageProvider.LoadAllChildrenAsync<T>(string key) where T : default => throw new NotImplementedException(); + Task<T?> IStorageProvider.LoadAllChildrenAsync<T>(string key) where T : default => throw new NotImplementedException(); async Task IStorageProvider.SaveObjectAsync<T>(string key, T value) => await _localStorageService.SetItemAsync(key, value); diff --git a/MatrixRoomUtils.Web/Classes/MRUStorageWrapper.cs b/MatrixRoomUtils.Web/Classes/MRUStorageWrapper.cs index e9d56b9..14625fd 100644 --- a/MatrixRoomUtils.Web/Classes/MRUStorageWrapper.cs +++ b/MatrixRoomUtils.Web/Classes/MRUStorageWrapper.cs @@ -45,10 +45,7 @@ public class MRUStorageWrapper { } public async Task AddToken(LoginResponse loginResponse) { - var tokens = await GetAllTokens(); - if (tokens == null) { - tokens = new List<LoginResponse>(); - } + var tokens = await GetAllTokens() ?? new List<LoginResponse>(); tokens.Add(loginResponse); await _storageService.DataStorageProvider.SaveObjectAsync("mru.tokens", tokens); @@ -92,9 +89,9 @@ public class MRUStorageWrapper { } public class DeveloperSettings { - public bool EnableLogViewers { get; set; } = false; + public bool EnableLogViewers { get; set; } public bool EnableConsoleLogging { get; set; } = true; - public bool EnablePortableDevtools { get; set; } = false; + public bool EnablePortableDevtools { get; set; } } public async Task RemoveToken(LoginResponse auth) { @@ -107,7 +104,5 @@ public class MRUStorageWrapper { await _storageService.DataStorageProvider.SaveObjectAsync("mru.tokens", tokens); } - public async Task SetCurrentToken(LoginResponse? auth) { - _storageService.DataStorageProvider.SaveObjectAsync("token", auth); - } + public async Task SetCurrentToken(LoginResponse? auth) => await _storageService.DataStorageProvider.SaveObjectAsync("token", auth); } diff --git a/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs b/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs index b6f6d56..bb2eab9 100644 --- a/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs +++ b/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs @@ -28,7 +28,7 @@ public class DefaultRoomCreationTemplate : IRoomCreationTemplate { }, new() { Type = "m.room.join_rules", - TypedContent = new JoinRulesEventData() { + TypedContent = new JoinRulesEventData { JoinRule = "public" } }, @@ -42,7 +42,7 @@ public class DefaultRoomCreationTemplate : IRoomCreationTemplate { }, new() { Type = "m.room.avatar", - TypedContent = new RoomAvatarEventData() { + TypedContent = new RoomAvatarEventData { Url = "mxc://feline.support/UKNhEyrVsrAbYteVvZloZcFj" } } diff --git a/MatrixRoomUtils.Web/Classes/RoomInfo.cs b/MatrixRoomUtils.Web/Classes/RoomInfo.cs index 4df81ec..111bfe0 100644 --- a/MatrixRoomUtils.Web/Classes/RoomInfo.cs +++ b/MatrixRoomUtils.Web/Classes/RoomInfo.cs @@ -11,10 +11,10 @@ public class RoomInfo { public async Task<StateEventResponse?> GetStateEvent(string type, string stateKey = "") { var @event = StateEvents.FirstOrDefault(x => x.Type == type && x.StateKey == stateKey); if (@event is not null) return @event; - @event = new StateEventResponse() { + @event = new StateEventResponse { RoomId = Room.RoomId, Type = type, - StateKey = stateKey, + StateKey = stateKey }; try { @event.TypedContent = await Room.GetStateAsync<object>(type, stateKey); diff --git a/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs b/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs index 6f11cad..a923015 100644 --- a/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs +++ b/MatrixRoomUtils.Web/Classes/SessionStorageProviderService.cs @@ -10,9 +10,11 @@ public class SessionStorageProviderService : IStorageProvider { _sessionStorageService = sessionStorage; } - async Task IStorageProvider.SaveAllChildrenAsync<T>(string key, T value) => throw new NotImplementedException(); + Task IStorageProvider.SaveAllChildrenAsync<T>(string key, T value) { + throw new NotImplementedException(); + } - async Task<T?> IStorageProvider.LoadAllChildrenAsync<T>(string key) where T : default => throw new NotImplementedException(); + Task<T?> IStorageProvider.LoadAllChildrenAsync<T>(string key) where T : default => throw new NotImplementedException(); async Task IStorageProvider.SaveObjectAsync<T>(string key, T value) => await _sessionStorageService.SetItemAsync(key, value); |