diff --git a/ChatChannel/ChatHost.cs b/ChatChannel/ChatHost.cs index 9d0bc607..9cf71e35 100644 --- a/ChatChannel/ChatHost.cs +++ b/ChatChannel/ChatHost.cs @@ -11,11 +11,7 @@ namespace ChatChannel { - - public sealed class ChatHost() { public IHost Host { get; set; } - - } } diff --git a/Riverside.Graphite.Channels/Controllers/HomeController.cs b/Riverside.Graphite.Channels/Controllers/HomeController.cs index ea1a28bf..3fc5fa4f 100644 --- a/Riverside.Graphite.Channels/Controllers/HomeController.cs +++ b/Riverside.Graphite.Channels/Controllers/HomeController.cs @@ -19,12 +19,10 @@ public HomeController(IConfiguration configuration, IHubCommander commander, ILo _logger = logger; _commander = commander; _configuration = configuration; - } public IActionResult Index() { - ViewData["GraphApiResult"] = User.GetDisplayName(); return View(); } @@ -32,7 +30,6 @@ public IActionResult Index() [HttpGet("users/all")] public IActionResult GetallMsalUsers() { - var users = AzureChat.ConnectedIds.Select(t => t.Value).ToList(); // _commander?.MsalCurrentUsers; return new JsonResult(users!.Select(x => x).ToArray()); } diff --git a/Riverside.Graphite.Channels/Controllers/MessageBoardController.cs b/Riverside.Graphite.Channels/Controllers/MessageBoardController.cs index bc93367f..9c0c5def 100644 --- a/Riverside.Graphite.Channels/Controllers/MessageBoardController.cs +++ b/Riverside.Graphite.Channels/Controllers/MessageBoardController.cs @@ -1,4 +1,4 @@ -using FireCore.Services; +using FireCore.Services; using Microsoft.AspNetCore.Mvc; namespace FireCore.Controllers @@ -15,7 +15,6 @@ public MessageBoardController(IHubContextStore hubContextStore, IHubCommander co _contextStore = hubContextStore; _commander = commander; _configuration = configuration; - } #endregion; @@ -30,10 +29,9 @@ public async Task Index() foreach (var cookie in Request.Cookies) { Response.Cookies.Delete(cookie.Key); } Console.Write(e.Message!.ToString()); - }; + } return Redirect("~/"); - } } } diff --git a/Riverside.Graphite.Channels/Controllers/NegotiateController.cs b/Riverside.Graphite.Channels/Controllers/NegotiateController.cs index 5e687b20..22847bce 100644 --- a/Riverside.Graphite.Channels/Controllers/NegotiateController.cs +++ b/Riverside.Graphite.Channels/Controllers/NegotiateController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using FireCore.Services; @@ -8,7 +8,6 @@ namespace FireCore.Controllers { - [ApiController] public class NegotiateController : ControllerBase { @@ -22,7 +21,6 @@ public NegotiateController(IHubContextStore store, IConfiguration configuration) _messageHubContext = store.MessageHubContext; _chatHubContext = store.ChatHubContext; _enableDetailedErrors = configuration.GetValue(EnableDetailedErrors, false); - } [HttpPost("message/negotiate")] diff --git a/Riverside.Graphite.Channels/Data/Database/SessionContext.cs b/Riverside.Graphite.Channels/Data/Database/SessionContext.cs index a56ee109..ccceba2e 100644 --- a/Riverside.Graphite.Channels/Data/Database/SessionContext.cs +++ b/Riverside.Graphite.Channels/Data/Database/SessionContext.cs @@ -1,4 +1,4 @@ -using FireCore.Data.Models; +using FireCore.Data.Models; using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; @@ -18,7 +18,6 @@ public SessionContext(IWebHostEnvironment webHostEnvironment) public SessionContext(DbContextOptions options) : base(options) { - } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -31,13 +30,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { model.Property(e => e.DateTime).HasDefaultValue(DateTimeOffset.Now); modelBuilder.Entity(); - }); base.OnModelCreating(modelBuilder); } - } - - } diff --git a/Riverside.Graphite.Channels/Data/Models/Contracts/ISessionDbEntity.cs b/Riverside.Graphite.Channels/Data/Models/Contracts/ISessionDbEntity.cs index 5bb5a4b4..35f5186e 100644 --- a/Riverside.Graphite.Channels/Data/Models/Contracts/ISessionDbEntity.cs +++ b/Riverside.Graphite.Channels/Data/Models/Contracts/ISessionDbEntity.cs @@ -1,4 +1,4 @@ -namespace FireCore.Data.Models.Contracts +namespace FireCore.Data.Models.Contracts { public interface ISessionDbEntity { @@ -7,6 +7,5 @@ public interface ISessionDbEntity public string? PartnerName { get; set; } public string? SessionId { get; set; } public DateTimeOffset DateTime { get; set; } - } } diff --git a/Riverside.Graphite.Channels/Models/ErrorViewModel.cs b/Riverside.Graphite.Channels/Models/ErrorViewModel.cs index 6f8f9051..0d09d0d4 100644 --- a/Riverside.Graphite.Channels/Models/ErrorViewModel.cs +++ b/Riverside.Graphite.Channels/Models/ErrorViewModel.cs @@ -42,5 +42,4 @@ protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } - } diff --git a/Riverside.Graphite.Channels/Models/MessageBoardViewModel.cs b/Riverside.Graphite.Channels/Models/MessageBoardViewModel.cs index 26653064..19303bb9 100644 --- a/Riverside.Graphite.Channels/Models/MessageBoardViewModel.cs +++ b/Riverside.Graphite.Channels/Models/MessageBoardViewModel.cs @@ -1,9 +1,8 @@ -using FireCore.Services; +using FireCore.Services; using FireCore.Services.Hubs; namespace FireCore.Models { - using Microsoft.AspNetCore.SignalR; using Microsoft.Extensions.Logging; using System; @@ -72,7 +71,6 @@ public Task Initialize() var users = AzureChat.ConnectedIds?.Select(t => t.Value).ToList(); _commander!.MsalCurrentUsers = users!.ToList(); - } catch (Exception e) { @@ -82,5 +80,4 @@ public Task Initialize() return Task.CompletedTask; } } - } diff --git a/Riverside.Graphite.Channels/Program.cs b/Riverside.Graphite.Channels/Program.cs index 52d0e2c6..99521e5e 100644 --- a/Riverside.Graphite.Channels/Program.cs +++ b/Riverside.Graphite.Channels/Program.cs @@ -26,11 +26,9 @@ public static void Main(string[] args) var builder = Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder(args); builder.WebHost.UseKestrel(x => x.ListenAnyIP(5000)); Startup(builder); - } public static void Startup(WebApplicationBuilder builder) { - _ = builder.Services.AddHttpClient(); _ = builder.Services.AddRouting(); _ = builder.Services.AddControllersWithViews().AddRazorRuntimeCompilation(); @@ -51,7 +49,6 @@ public static void Startup(WebApplicationBuilder builder) { new Claim(ClaimTypes.NameIdentifier, context?.Request?.Query["username"]!) ]; options.ServerStickyMode = Microsoft.Azure.SignalR.ServerStickyMode.Preferred; - }); _ = builder.Services.AddSingleton(); @@ -94,7 +91,6 @@ public static void Startup(WebApplicationBuilder builder) { endpoints.MapControllers(); endpoints.MapRazorPages(); endpoints.MapHub("/chat"); - }); app.MapControllerRoute( @@ -103,8 +99,6 @@ public static void Startup(WebApplicationBuilder builder) { app.Run(); - } - } } \ No newline at end of file diff --git a/Riverside.Graphite.Channels/Services/Contracts/MessageHandler/AzureTableMessageStorage/MessageEntity.cs b/Riverside.Graphite.Channels/Services/Contracts/MessageHandler/AzureTableMessageStorage/MessageEntity.cs index cb71b33f..d7ad9ab1 100644 --- a/Riverside.Graphite.Channels/Services/Contracts/MessageHandler/AzureTableMessageStorage/MessageEntity.cs +++ b/Riverside.Graphite.Channels/Services/Contracts/MessageHandler/AzureTableMessageStorage/MessageEntity.cs @@ -1,11 +1,10 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Azure; namespace FireCore.Services.Contracts.MessageHandler.AzureTableMessageStorage { - public class MessageEntity : Azure.Data.Tables.ITableEntity { public string RowKey { get; set; } = default!; diff --git a/Riverside.Graphite.Channels/Services/Contracts/SessionHandler/AzureTableSessionStorage/AzureDataTableSession.cs b/Riverside.Graphite.Channels/Services/Contracts/SessionHandler/AzureTableSessionStorage/AzureDataTableSession.cs index 396c160f..7da4b5b2 100644 --- a/Riverside.Graphite.Channels/Services/Contracts/SessionHandler/AzureTableSessionStorage/AzureDataTableSession.cs +++ b/Riverside.Graphite.Channels/Services/Contracts/SessionHandler/AzureTableSessionStorage/AzureDataTableSession.cs @@ -1,4 +1,4 @@ -using Azure.Data.Tables; +using Azure.Data.Tables; namespace FireCore.Services.Contracts.SessionHandler.AzureTableSessionStorage @@ -29,18 +29,15 @@ public AzureDataTableSession(IConfiguration configuration, SignalRService signal } public async Task InitializeTables() { - _tableServiceClient = new(_configuration?.GetRequiredSection("AzureStorage").Value!); _tableClient = _tableServiceClient?.GetTableClient("SessionTable"); await _tableClient!.CreateIfNotExistsAsync().ConfigureAwait(false); return Task.CompletedTask; - } internal async Task SetPrivateSession(string userName, string partnerName) { - var result = _tableClient?.QueryAsync(x => x.PartitionKey == userName && x.RowKey == partnerName).AsPages().ToBlockingEnumerable(); if (result!.Count() > 0) @@ -48,13 +45,10 @@ public async Task InitializeTables() return await Task.FromResult(new Session(result?.First().Values!.Select(x => x.SessionId).ToString()!)); } else { return null; } - - } public async Task IsUserActive(string roomNameUserName) { - var answer = _tableClient?.QueryAsync(x => x.PartitionKey == roomNameUserName).AsPages().ToBlockingEnumerable(); if (answer!.Count() > 0) @@ -63,11 +57,9 @@ public async Task IsUserActive(string roomNameUserName) } return await Task.FromResult(false); - } public async Task DeleteUserSession(string userName, string partnerName) { - var answer = _tableClient?.QueryAsync(x => x.PartitionKey == userName && x.RowKey == partnerName); var batchIt = new List(); @@ -85,7 +77,6 @@ public async Task DeleteUserSession(string userName, string partnerName) } return false; - } public async Task GetOrCreateSessionAsync(string userName, string partnerName) { @@ -95,7 +86,6 @@ public async Task GetOrCreateSessionAsync(string userName, string partn if (isJointRoom is null) { - var isPartnerJoint = await SetPrivateSession(partnerName, userName); if (isPartnerJoint is not null) @@ -114,7 +104,6 @@ public async Task GetOrCreateSessionAsync(string userName, string partn await _tableClient!.AddEntityAsync(new SQL_SESSION_ENTITY(partnerName, userName, session)); return session; } - } } @@ -124,7 +113,6 @@ public async Task GetOrCreateSessionAsync(string userName, string partn if (sql?.ToBlockingEnumerable().Count() > 0) { - var sessionExists = _tableClient?.GetEntityIfExists(userName, partnerName); if (sessionExists!.HasValue) @@ -147,12 +135,10 @@ public async Task GetOrCreateSessionAsync(string userName, string partn await _tableClient!.AddEntityAsync(new SQL_SESSION_ENTITY(userName, partnerName, newSession)); return newSession; } - } public async Task> GetSessionBySessionId(string sessionId) { - var answer = _tableClient?.QueryAsync(x => x.SessionId == sessionId).AsPages(); var sessions = new List(); @@ -163,11 +149,9 @@ public async Task> GetSessionBySessionId(string session } return sessions; - } public async Task[]> GetLatestSessionsAsync(string userName) { - var result = _tableClient?.QueryAsync(s => s.PartitionKey == userName).ConfigureAwait(false); var sessions = new SortedDictionary(); @@ -179,9 +163,6 @@ public async Task[]> GetLatestSessionsAsync(string return sessions.ToArray(); } - - } - } diff --git a/Riverside.Graphite.Channels/Services/Contracts/SessionHandler/AzureTableSessionStorage/SessionEntity.cs b/Riverside.Graphite.Channels/Services/Contracts/SessionHandler/AzureTableSessionStorage/SessionEntity.cs index 58e729a4..080f4037 100644 --- a/Riverside.Graphite.Channels/Services/Contracts/SessionHandler/AzureTableSessionStorage/SessionEntity.cs +++ b/Riverside.Graphite.Channels/Services/Contracts/SessionHandler/AzureTableSessionStorage/SessionEntity.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Azure; @@ -6,7 +6,6 @@ namespace FireCore.Services.Contracts.SessionHandler.AzureTableSessionStorage { - public class SQL_SESSION_ENTITY : ITableEntity { public string RowKey { get; set; } = default!; diff --git a/Riverside.Graphite.Channels/Services/HubCommander.cs b/Riverside.Graphite.Channels/Services/HubCommander.cs index e09cd8da..876828e7 100644 --- a/Riverside.Graphite.Channels/Services/HubCommander.cs +++ b/Riverside.Graphite.Channels/Services/HubCommander.cs @@ -1,4 +1,4 @@ - + using FireCore.Data.Models; using System.Collections.Concurrent; @@ -13,7 +13,6 @@ public interface IHubCommander Task DeleteAllSessionsByUser(string connectionId); ConcurrentDictionary, string> ActiveGroups { get; } List? MsalCurrentUsers { get; set; } - } public sealed class HubCommander : IHubCommander { @@ -34,7 +33,6 @@ public HubCommander(List msalCurrentUsers) public async Task DeleteAllSessionsByUser(string connectionId) { - var success = false; try @@ -48,13 +46,10 @@ public async Task DeleteAllSessionsByUser(string connectionId) { success = await DeleteAsync(item); } - } - } catch (Exception) { - throw; } return (success); @@ -70,7 +65,6 @@ public Task DeleteAsync(Tuple key) { throw; } - } public Task GetSessionIdAsync(Tuple key) @@ -85,17 +79,14 @@ public Task GetSessionIdAsync(Tuple key) { throw; } - } public Task WriteAsync(SessionDbEntity entity) { try { - var result = _inMemoryStorage?.TryAdd(new Tuple(entity.ConnectionId, entity.PartnerName), entity.SessionId); return Task.FromResult((bool)result!); - } catch (Exception ex) { @@ -103,6 +94,5 @@ public Task WriteAsync(SessionDbEntity entity) throw; } } - } } \ No newline at end of file diff --git a/Riverside.Graphite.Channels/Services/Hubs/AzureChat.cs b/Riverside.Graphite.Channels/Services/Hubs/AzureChat.cs index 887f3254..0e40ac80 100644 --- a/Riverside.Graphite.Channels/Services/Hubs/AzureChat.cs +++ b/Riverside.Graphite.Channels/Services/Hubs/AzureChat.cs @@ -12,8 +12,6 @@ namespace FireCore.Services.Hubs { - - public class AzureChat : Hub { private readonly IMessageHandler _messageHandler; @@ -89,12 +87,10 @@ public override async Task OnDisconnectedAsync(Exception? exception) var message = new Message("Public", DateTime.Now, onDisconnectedMessage, "Sent"); await Clients!.All.SendAsync("sendNotify", onDisconnectedMessage); await base.OnDisconnectedAsync(exception); - } public async Task AddSessionsToCommander(KeyValuePair[] userSessions) { - await _commander.DeleteAllSessionsByUser(Context.ConnectionId); foreach (var session in userSessions) @@ -102,7 +98,6 @@ public async Task AddSessionsToCommander(KeyValuePair GetOrCreateSession(string receiver) } else { - var userSessions = await _azureDataTableSessionStorage.GetLatestSessionsAsync(sender!); await AddSessionsToCommander(userSessions); } await Task.Delay(400); return session.SessionId; - } public async Task SendUserMessage(string sessionId, string roomName, string messageContent) { @@ -181,7 +174,6 @@ public async Task SendUserMessage(string sessionId, string roomName, str await Clients!.User(roomName).SendAsync("displayUserMessage", sessionId, sequenceId, Context.UserIdentifier!, messageContent); await Clients!.Caller.SendAsync("displayResponseMessage", sessionId, sequenceId, "Sent"); await Clients!.User(roomName).SendAsync("sendPrivateMessage", sessionId, string.Format("You have a private message from: {0}", Context!.UserIdentifier), messageContent, sender!); - } else { @@ -190,8 +182,6 @@ public async Task SendUserMessage(string sessionId, string roomName, str } return sessionId; - - } public async Task SendUserResponse(string sessionId, string sequenceId, string receiver, string messageStatus) diff --git a/Riverside.Graphite.Channels/Services/SignalRService.cs b/Riverside.Graphite.Channels/Services/SignalRService.cs index 51e4d5b1..ca646b76 100644 --- a/Riverside.Graphite.Channels/Services/SignalRService.cs +++ b/Riverside.Graphite.Channels/Services/SignalRService.cs @@ -1,11 +1,10 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Azure.SignalR.Management; namespace FireCore.Services { - public interface IHubContextStore { ServiceHubContext MessageHubContext { get; set; } @@ -38,7 +37,6 @@ async Task IHostedService.StartAsync(CancellationToken cancellationToken) MessageHubContext = await serviceManager.CreateHubContextAsync(MessageHub, cancellationToken); ChatHubContext = await serviceManager.CreateHubContextAsync(ChatHub, cancellationToken); - } @@ -61,7 +59,5 @@ public void Dispose() MessageHubContext?.Dispose(); ChatHubContext?.Dispose(); } - - } } \ No newline at end of file diff --git a/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/css/bootstrap.css b/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/css/bootstrap.css index b7ab57f2..ad62ed37 100644 --- a/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/css/bootstrap.css +++ b/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/css/bootstrap.css @@ -1876,7 +1876,7 @@ progress { border-color: var(--bs-table-border-color); } .table > :not(caption) > * > * { - padding: 0.5rem 0.5rem; + padding: 0.5rem; color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color))); background-color: var(--bs-table-bg); border-bottom-width: var(--bs-border-width); @@ -1898,7 +1898,7 @@ progress { } .table-sm > :not(caption) > * > * { - padding: 0.25rem 0.25rem; + padding: 0.25rem; } .table-bordered > :not(caption) > * { @@ -5367,7 +5367,7 @@ textarea.form-control-lg { box-sizing: content-box; width: 1em; height: 1em; - padding: 0.25em 0.25em; + padding: 0.25em; color: var(--bs-btn-close-color); background: transparent var(--bs-btn-close-bg) center/1em auto no-repeat; border: 0; @@ -12052,6 +12052,4 @@ textarea.form-control-lg { .d-print-none { display: none !important; } -} - -/*# sourceMappingURL=bootstrap.css.map */ \ No newline at end of file +} \ No newline at end of file diff --git a/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/css/bootstrap.rtl.css b/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/css/bootstrap.rtl.css index 753823c2..061b0038 100644 --- a/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/css/bootstrap.rtl.css +++ b/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/css/bootstrap.rtl.css @@ -1874,7 +1874,7 @@ progress { border-color: var(--bs-table-border-color); } .table > :not(caption) > * > * { - padding: 0.5rem 0.5rem; + padding: 0.5rem; color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color))); background-color: var(--bs-table-bg); border-bottom-width: var(--bs-border-width); @@ -1896,7 +1896,7 @@ progress { } .table-sm > :not(caption) > * > * { - padding: 0.25rem 0.25rem; + padding: 0.25rem; } .table-bordered > :not(caption) > * { @@ -5365,7 +5365,7 @@ textarea.form-control-lg { box-sizing: content-box; width: 1em; height: 1em; - padding: 0.25em 0.25em; + padding: 0.25em; color: var(--bs-btn-close-color); background: transparent var(--bs-btn-close-bg) center/1em auto no-repeat; border: 0; @@ -12026,5 +12026,4 @@ textarea.form-control-lg { .d-print-none { display: none !important; } -} -/*# sourceMappingURL=bootstrap.rtl.css.map */ \ No newline at end of file +} \ No newline at end of file diff --git a/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/dist/css/bootstrap.css b/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/dist/css/bootstrap.css index 750da4e1..9dcec340 100644 --- a/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/dist/css/bootstrap.css +++ b/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/dist/css/bootstrap.css @@ -1962,7 +1962,7 @@ progress { border-color: #dee2e6; } .table > :not(caption) > * > * { - padding: 0.5rem 0.5rem; + padding: 0.5rem; background-color: var(--bs-table-bg); border-bottom-width: 1px; box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg); @@ -1982,7 +1982,7 @@ progress { } .table-sm > :not(caption) > * > * { - padding: 0.25rem 0.25rem; + padding: 0.25rem; } .table-bordered > :not(caption) > * { @@ -4477,7 +4477,7 @@ textarea.form-control-lg { .card-body { flex: 1 1 auto; - padding: 1rem 1rem; + padding: 1rem; } .card-title { @@ -4710,7 +4710,7 @@ textarea.form-control-lg { .breadcrumb { display: flex; flex-wrap: wrap; - padding: 0 0; + padding: 0; margin-bottom: 1rem; list-style: none; } @@ -4840,7 +4840,7 @@ textarea.form-control-lg { .alert { position: relative; - padding: 1rem 1rem; + padding: 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; @@ -5328,7 +5328,7 @@ textarea.form-control-lg { box-sizing: content-box; width: 1em; height: 1em; - padding: 0.25em 0.25em; + padding: 0.25em; color: #000; background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat; border: 0; @@ -5493,13 +5493,13 @@ textarea.form-control-lg { flex-shrink: 0; align-items: center; justify-content: space-between; - padding: 1rem 1rem; + padding: 1rem; border-bottom: 1px solid #dee2e6; border-top-left-radius: calc(0.3rem - 1px); border-top-right-radius: calc(0.3rem - 1px); } .modal-header .btn-close { - padding: 0.5rem 0.5rem; + padding: 0.5rem; margin: -0.5rem -0.5rem -0.5rem auto; } @@ -5866,12 +5866,12 @@ textarea.form-control-lg { } .bs-popover-bottom > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow::before { top: 0; - border-width: 0 0.5rem 0.5rem 0.5rem; + border-width: 0 0.5rem 0.5rem; border-bottom-color: rgba(0, 0, 0, 0.25); } .bs-popover-bottom > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow::after { top: 1px; - border-width: 0 0.5rem 0.5rem 0.5rem; + border-width: 0 0.5rem 0.5rem; border-bottom-color: #fff; } .bs-popover-bottom .popover-header::before, .bs-popover-auto[data-popper-placement^=bottom] .popover-header::before { @@ -5915,7 +5915,7 @@ textarea.form-control-lg { } .popover-body { - padding: 1rem 1rem; + padding: 1rem; color: #212529; } @@ -6237,10 +6237,10 @@ textarea.form-control-lg { display: flex; align-items: center; justify-content: space-between; - padding: 1rem 1rem; + padding: 1rem; } .offcanvas-header .btn-close { - padding: 0.5rem 0.5rem; + padding: 0.5rem; margin-top: -0.5rem; margin-right: -0.5rem; margin-bottom: -0.5rem; @@ -6253,7 +6253,7 @@ textarea.form-control-lg { .offcanvas-body { flex-grow: 1; - padding: 1rem 1rem; + padding: 1rem; overflow-y: auto; } @@ -11216,6 +11216,4 @@ textarea.form-control-lg { .d-print-none { display: none !important; } -} - -/*# sourceMappingURL=bootstrap.css.map */ \ No newline at end of file +} \ No newline at end of file diff --git a/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.css b/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.css index 52fc4e2c..02a9bbfb 100644 --- a/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.css +++ b/Riverside.Graphite.Channels/wwwroot/lib/bootstrap/dist/css/bootstrap.rtl.css @@ -1960,7 +1960,7 @@ progress { border-color: #dee2e6; } .table > :not(caption) > * > * { - padding: 0.5rem 0.5rem; + padding: 0.5rem; background-color: var(--bs-table-bg); border-bottom-width: 1px; box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg); @@ -1980,7 +1980,7 @@ progress { } .table-sm > :not(caption) > * > * { - padding: 0.25rem 0.25rem; + padding: 0.25rem; } .table-bordered > :not(caption) > * { @@ -4475,7 +4475,7 @@ textarea.form-control-lg { .card-body { flex: 1 1 auto; - padding: 1rem 1rem; + padding: 1rem; } .card-title { @@ -4708,7 +4708,7 @@ textarea.form-control-lg { .breadcrumb { display: flex; flex-wrap: wrap; - padding: 0 0; + padding: 0; margin-bottom: 1rem; list-style: none; } @@ -4838,7 +4838,7 @@ textarea.form-control-lg { .alert { position: relative; - padding: 1rem 1rem; + padding: 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; @@ -5326,7 +5326,7 @@ textarea.form-control-lg { box-sizing: content-box; width: 1em; height: 1em; - padding: 0.25em 0.25em; + padding: 0.25em; color: #000; background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat; border: 0; @@ -5491,13 +5491,13 @@ textarea.form-control-lg { flex-shrink: 0; align-items: center; justify-content: space-between; - padding: 1rem 1rem; + padding: 1rem; border-bottom: 1px solid #dee2e6; border-top-right-radius: calc(0.3rem - 1px); border-top-left-radius: calc(0.3rem - 1px); } .modal-header .btn-close { - padding: 0.5rem 0.5rem; + padding: 0.5rem; margin: -0.5rem auto -0.5rem -0.5rem; } @@ -5864,12 +5864,12 @@ textarea.form-control-lg { } .bs-popover-bottom > .popover-arrow::before, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow::before { top: 0; - border-width: 0 0.5rem 0.5rem 0.5rem; + border-width: 0 0.5rem 0.5rem; border-bottom-color: rgba(0, 0, 0, 0.25); } .bs-popover-bottom > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow::after { top: 1px; - border-width: 0 0.5rem 0.5rem 0.5rem; + border-width: 0 0.5rem 0.5rem; border-bottom-color: #fff; } .bs-popover-bottom .popover-header::before, .bs-popover-auto[data-popper-placement^=bottom] .popover-header::before { @@ -5913,7 +5913,7 @@ textarea.form-control-lg { } .popover-body { - padding: 1rem 1rem; + padding: 1rem; color: #212529; } @@ -6222,10 +6222,10 @@ textarea.form-control-lg { display: flex; align-items: center; justify-content: space-between; - padding: 1rem 1rem; + padding: 1rem; } .offcanvas-header .btn-close { - padding: 0.5rem 0.5rem; + padding: 0.5rem; margin-top: -0.5rem; margin-left: -0.5rem; margin-bottom: -0.5rem; @@ -6238,7 +6238,7 @@ textarea.form-control-lg { .offcanvas-body { flex-grow: 1; - padding: 1rem 1rem; + padding: 1rem; overflow-y: auto; } @@ -11193,5 +11193,4 @@ textarea.form-control-lg { .d-print-none { display: none !important; } -} -/*# sourceMappingURL=bootstrap.rtl.css.map */ \ No newline at end of file +} \ No newline at end of file diff --git a/Riverside.Graphite.Channels/wwwroot/lib/choices.js/choices.css b/Riverside.Graphite.Channels/wwwroot/lib/choices.js/choices.css index ed8ff340..c173461a 100644 --- a/Riverside.Graphite.Channels/wwwroot/lib/choices.js/choices.css +++ b/Riverside.Graphite.Channels/wwwroot/lib/choices.js/choices.css @@ -72,7 +72,7 @@ height: 0; width: 0; border-style: solid; - border-color: #333 transparent transparent transparent; + border-color: #333 transparent transparent; border-width: 5px; position: absolute; right: 11.5px; @@ -81,7 +81,7 @@ pointer-events: none; } .choices[data-type*=select-one].is-open::after { - border-color: transparent transparent #333 transparent; + border-color: transparent transparent #333; margin-top: -7.5px; } .choices[data-type*=select-one][dir=rtl]::after { diff --git a/Riverside.Graphite.Channels/wwwroot/lib/font-awesome@6.5.2/js/conflict-detection.js b/Riverside.Graphite.Channels/wwwroot/lib/font-awesome@6.5.2/js/conflict-detection.js index ea79da3d..10946b6e 100644 --- a/Riverside.Graphite.Channels/wwwroot/lib/font-awesome@6.5.2/js/conflict-detection.js +++ b/Riverside.Graphite.Channels/wwwroot/lib/font-awesome@6.5.2/js/conflict-detection.js @@ -624,7 +624,7 @@ } else if (node.href) { return md5(node.href); } else if (node.innerText && '' !== node.innerText) { - // eslint-disable-line yoda + return md5(node.innerText); } else { return undefined; @@ -665,8 +665,8 @@ console.info(progressIndicator); } - if (!!result) { - // eslint-disable-line no-extra-boolean-cast + if (result) { + resolve(result); } else { var nextDuration = 250; @@ -675,7 +675,7 @@ if (nextCumulativeDuration <= maxDuration) { poll(nextDuration, nextCumulativeDuration); } else { - reject('timeout'); // eslint-disable-line prefer-promise-reject-errors + reject('timeout'); } } }, duration); diff --git a/Riverside.Graphite.Core/AuthService.cs b/Riverside.Graphite.Core/AuthService.cs index 38d94270..8948ee5f 100644 --- a/Riverside.Graphite.Core/AuthService.cs +++ b/Riverside.Graphite.Core/AuthService.cs @@ -86,14 +86,12 @@ private static void SaveUsers() #nullable enable public static User? UserExists(string userName) { - if (users.Any(t => t.Username == userName)) { return users.Where(t => t.Username == userName).FirstOrDefault(); } return null; - } public static List GetAllUsernames() diff --git a/Riverside.Graphite.Data.Core/Update/SchemaExtractor.cs b/Riverside.Graphite.Data.Core/Update/SchemaExtractor.cs index e7ede7d3..46bf06e0 100644 --- a/Riverside.Graphite.Data.Core/Update/SchemaExtractor.cs +++ b/Riverside.Graphite.Data.Core/Update/SchemaExtractor.cs @@ -1,4 +1,4 @@ -using JsonDiffPatchDotNet; +using JsonDiffPatchDotNet; using Microsoft.Data.Sqlite; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -26,7 +26,6 @@ public class SchemaExtractor public SchemaExtractor(string connectionString, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type classIn) { - if (string.IsNullOrWhiteSpace(connectionString)) throw new ArgumentNullException(nameof(connectionString)); @@ -41,8 +40,6 @@ public SchemaExtractor(string connectionString, [DynamicallyAccessedMembers(Dyna public async Task HandleExtractionSchemaChanges() { - - var oldSchemaJson = GetDatabaseSchemaAsJson(connectionString, classIn.Name); var newSchemaJson = GetPropertyNamesOnlyJson(classIn); @@ -56,7 +53,6 @@ public async Task HandleExtractionSchemaChanges() JObject Jobj = JsonConvert.DeserializeObject(diff); foreach (var item in Jobj.Properties()) { - var prop = GetPropertyNamesIncludePropertyName(classIn, item.Value.ToString()); if (prop is not null) properties.Add(prop); @@ -79,7 +75,6 @@ public async Task HandleExtractionSchemaChanges() public static async Task AddNameColumnsFromProperties(string connectionString, string strTableName, PropertyInfo property) { - try { // capture db, datatype, defaults->go; @@ -137,7 +132,6 @@ public static async Task AddNameColumnsFromProperties(string connectionString, s } await Task.Delay(100); - } public static string GetDatabaseSchemaAsJson(string connectionString, string strTableName) { @@ -171,7 +165,6 @@ public static string GetDatabaseSchemaAsJson(string connectionString, string str } public static bool IsJsonArray(string jsonString) { - try { JToken token = JToken.Parse(jsonString.Replace('\'', '\"')); @@ -194,13 +187,11 @@ public static PropertyInfo GetPropertyNamesIncludePropertyName([DynamicallyAcces var list = type.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(o => o.Name == p_name).FirstOrDefault(); return list; - } public static string GetPropertyNamesOnlyJson([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type type) { var list = type.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(o => o.Name != "Self").Select(p => p.Name).ToList(); return JsonConvert.SerializeObject(list, Formatting.None); - } public string SerializeModelSchema(Type classIn) @@ -218,8 +209,6 @@ public string CompareSchemas(string oldSchemaJson, string newSchemaJson) else return null; } - } - } diff --git a/Riverside.Graphite.Runtime/Helpers/Windowing.cs b/Riverside.Graphite.Runtime/Helpers/Windowing.cs index 2efad63b..86c950a9 100644 --- a/Riverside.Graphite.Runtime/Helpers/Windowing.cs +++ b/Riverside.Graphite.Runtime/Helpers/Windowing.cs @@ -1,4 +1,4 @@ -using Microsoft.UI; +using Microsoft.UI; using Microsoft.UI.Windowing; using Microsoft.UI.Xaml; using System; @@ -15,7 +15,6 @@ namespace Riverside.Graphite.Runtime.Helpers; public class WindowBounce(Window inWindow) { - private DispatcherTimer timer; private int bounceCount = 0; private int screenWidth, screenHeight, windowWidth, windowHeight; @@ -23,7 +22,6 @@ public class WindowBounce(Window inWindow) public async Task ShowWindowBounce() { - IntPtr hWnd = WindowNative.GetWindowHandle(inWindow); WindowId wndId = Win32Interop.GetWindowIdFromWindow(hWnd); AppWindow appWindow = AppWindow.GetFromWindowId(wndId); @@ -70,7 +68,6 @@ private void AnimateWindow(IntPtr hwnd) _ = Windowing.SetWindowPos(hwnd, IntPtr.Zero, centerX, endY, 0, 0, Windowing.SWP_NOZORDER | Windowing.SWP_NOSIZE); } } - } public class Windowing { @@ -267,7 +264,6 @@ public override string ToString() public static SizeInt32 GetTheSizeofWindow(IntPtr hWnd) { - SizeInt32 size = new SizeInt32(); RECT rect; @@ -275,17 +271,14 @@ public static SizeInt32 GetTheSizeofWindow(IntPtr hWnd) { size.Width = rect.right - rect.left; size.Height = rect.bottom - rect.top; - } return size; - } public static WindowInfo Commander { get; private set; } public static async void AllowNonOverlappingWindow(Window inWindow) { - var dlg = GetAppWindow(inWindow); var winSize = await SizeWindow(); var hWnd = WindowNative.GetWindowHandle(inWindow); @@ -294,7 +287,6 @@ public static async void AllowNonOverlappingWindow(Window inWindow) if (dlg is not null) { - var winParentId = Win32Interop.GetWindowIdFromWindow(parent); Microsoft.UI.Windowing.DisplayArea displayArea = Microsoft.UI.Windowing.DisplayArea.GetFromWindowId(winParentId, Microsoft.UI.Windowing.DisplayAreaFallback.Nearest); @@ -320,12 +312,8 @@ public static async void AllowNonOverlappingWindow(Window inWindow) var newSize = new SizeInt32((int)displayArea.WorkArea.Width - dlg.Size.Width - PositionOfNewWindow, parentSize.Height); ChangeWindowSize(parent, newSize.Width, newSize.Height); - - } - } - } PositionOfNewWindow += 15; } diff --git a/Riverside.Graphite/App.xaml.cs b/Riverside.Graphite/App.xaml.cs index 6c597702..c61a9d75 100644 --- a/Riverside.Graphite/App.xaml.cs +++ b/Riverside.Graphite/App.xaml.cs @@ -106,7 +106,6 @@ public App() ExceptionLogger.LogException(e); throw; } - } static void KillProcessByName(string processName) @@ -164,7 +163,6 @@ private void StartChannels() ExceptionLogger.LogException(e); throw; } - } public static string Get_Appx_AssemblyDirectory(Assembly assembly) @@ -173,7 +171,6 @@ public static string Get_Appx_AssemblyDirectory(Assembly assembly) string directoryPath = Path.GetDirectoryName(assemblyLocation); return directoryPath ?? throw new DirectoryNotFoundException("Publish directory not found"); - } public static string GetFullPathToExe() { diff --git a/Riverside.Graphite/Controls/AlphaFilter.xaml.cs b/Riverside.Graphite/Controls/AlphaFilter.xaml.cs index 5bd2ebdf..13a5f748 100644 --- a/Riverside.Graphite/Controls/AlphaFilter.xaml.cs +++ b/Riverside.Graphite/Controls/AlphaFilter.xaml.cs @@ -26,6 +26,5 @@ private void GridView_SelectionChanged(object sender, SelectionChangedEventArgs } this.Hide(); } - } diff --git a/Riverside.Graphite/Controls/ContentPage.xaml.cs b/Riverside.Graphite/Controls/ContentPage.xaml.cs index 43bc8d6d..c8d0bcf4 100644 --- a/Riverside.Graphite/Controls/ContentPage.xaml.cs +++ b/Riverside.Graphite/Controls/ContentPage.xaml.cs @@ -14,6 +14,5 @@ public ContentPage() { this.InitializeComponent(); } - } } diff --git a/Riverside.Graphite/Controls/GroupGridView.xaml.cs b/Riverside.Graphite/Controls/GroupGridView.xaml.cs index c0768cd4..c17b9a7c 100644 --- a/Riverside.Graphite/Controls/GroupGridView.xaml.cs +++ b/Riverside.Graphite/Controls/GroupGridView.xaml.cs @@ -32,12 +32,10 @@ public sealed partial class GroupGridView : Page public ItemGrouped Selected { get; set; } public GroupGridView() { - this.InitializeComponent(); ViewModelSourced = new SourceViewModel(); ViewModelGrouped = new GroupedViewModel(ViewModelSourced); DataContext = ViewModelGrouped; - } @@ -74,14 +72,11 @@ private void Grid_RightTapped(object sender, Microsoft.UI.Xaml.Input.RightTapped await ViewModelSourced.GetHistoryItems(); ViewModelGrouped.GroupedItems = await ViewModelGrouped.GetGroupedData(ViewModelSourced); ViewModelGrouped.RaisePropertyChanges(nameof(ViewModelGrouped.GroupedItems)); - }; flyout.Items.Add(deleteMenuItem); flyout.ShowAt((FrameworkElement)sender, e.GetPosition((FrameworkElement)sender)); - - } private void GroupHeader_Click(object sender, RoutedEventArgs e) { @@ -157,8 +152,6 @@ private void GridView_SelectionChanged(object sender, SelectionChangedEventArgs win.HistoryFlyoutMenu.Hide(); } } - - } public class ItemGrouped : HistoryItem { @@ -190,8 +183,6 @@ public void RaisePropertyChanges([CallerMemberName] string? propertyName = null) public async Task GetHistoryItems() { - - try { ObservableCollection HistoryItems = await FetchBrowserHistoryItems(); @@ -208,7 +199,6 @@ public async Task GetHistoryItems() foreach (var data in item) { Items.Add(new ItemGrouped(data)); - } } OnPropertyChanged(nameof(Items)); @@ -217,7 +207,6 @@ public async Task GetHistoryItems() { ExceptionLogger.LogException(e); } - } @@ -246,14 +235,12 @@ public class GroupedViewModel : ObservableObject public GroupedViewModel(SourceViewModel viewModel) { - GetGroupedData(viewModel).ConfigureAwait(false); GroupedItems = GetGroupedData(viewModel).GetAwaiter().GetResult(); } public Task GetGroupedData(SourceViewModel viewModel) { - DateTime sevenDaysAgo = DateTime.Now.AddDays(-7); var collection = new CollectionViewSource @@ -273,5 +260,4 @@ public void RaisePropertyChanges([CallerMemberName] string? propertyName = null) OnPropertyChanged(propertyName); } } - } diff --git a/Riverside.Graphite/Controls/MsalAuth.xaml.cs b/Riverside.Graphite/Controls/MsalAuth.xaml.cs index 62315511..1d5d82e5 100644 --- a/Riverside.Graphite/Controls/MsalAuth.xaml.cs +++ b/Riverside.Graphite/Controls/MsalAuth.xaml.cs @@ -32,7 +32,6 @@ public MsalAuth() string browserFolderPath = Path.Combine(UserDataManager.CoreFolderPath, "Users", AuthService.CurrentUser?.Username, "Browser"); Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", browserFolderPath); Environment.SetEnvironmentVariable("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS", "--enable-features=msSingleSignOnOSForPrimaryAccountIsShared"); - } public async Task Initialize(MainWindowViewModel mainWindowViewModel) @@ -42,8 +41,6 @@ public async Task Initialize(MainWindowViewModel mainWindowViewModel) SetWebViewHandler(webView); webView.CoreWebView2.SetVirtualHostNameToFolderMapping("fireapp.msal", "Assets/WebView/AppFrontend", CoreWebView2HostResourceAccessKind.Allow); webView.CoreWebView2.Navigate("https://fireapp.msal/main.html"); - - } protected override async void OnNavigatedTo(NavigationEventArgs e) @@ -61,7 +58,6 @@ protected override async void OnNavigatedTo(NavigationEventArgs e) private void SetWebViewHandler(WebView2 s) { - s.CoreWebView2.Settings.IsBuiltInErrorPageEnabled = true; s.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All); s.CoreWebView2.NewWindowRequested += CoreWebView2_NewWindowRequested; @@ -122,7 +118,6 @@ private async void WebResourceResponseReceived(CoreWebView2 sender, CoreWebView2 window.ViewModelMain.RaisePropertyChanges(nameof(window.ViewModelMain.IsMsLogin)); Console.WriteLine("Login successful."); } - } string script = @" @@ -203,7 +198,6 @@ private bool IsLoginSuccessful(CoreWebView2WebResourceResponseView response) private bool IsLogoutRequest(CoreWebView2WebResourceRequest request) { - string[] logoutUrls = { "https://login.live.com/logout", "https://login.microsoftonline.com/logout", "https://login.microsoftonline.com/common/oauth2/logout", "https://login.microsoftonline.com/common/oauth2/v2.0/logout?", "https://login.microsoftonline.com/common/oauth2/logoutsession" }; return logoutUrls.Any(logoutUrl => request.Uri.StartsWith(logoutUrl, StringComparison.OrdinalIgnoreCase)); } diff --git a/Riverside.Graphite/Helpers/PermissionManager.cs b/Riverside.Graphite/Helpers/PermissionManager.cs index 6ddf7301..2d0fa71f 100644 --- a/Riverside.Graphite/Helpers/PermissionManager.cs +++ b/Riverside.Graphite/Helpers/PermissionManager.cs @@ -1,4 +1,4 @@ -using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml; using Microsoft.Web.WebView2.Core; using Newtonsoft.Json; using Riverside.Graphite.Core; @@ -142,7 +142,6 @@ public static async Task HandlePermissionRequest( string url, CoreWebView2PermissionKind kind) { - if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(url)) { return CoreWebView2PermissionState.Deny; @@ -183,7 +182,6 @@ public static async Task GetEffectivePermissionStat string url, CoreWebView2PermissionKind kind) { - await LoadPermissionsAsync(username); var (storedPermission, _) = GetStoredPermission(username, url, kind); @@ -255,7 +253,6 @@ private static async Task SavePermissionsAsync(string username) { File.WriteAllText(filePath, json); } - } } catch (Exception ex) diff --git a/Riverside.Graphite/Helpers/WindowManager.cs b/Riverside.Graphite/Helpers/WindowManager.cs index b9eab868..47d5396e 100644 --- a/Riverside.Graphite/Helpers/WindowManager.cs +++ b/Riverside.Graphite/Helpers/WindowManager.cs @@ -1,4 +1,4 @@ -using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml; using System.Collections.Generic; namespace Riverside.Graphite.Helpers @@ -17,6 +17,4 @@ public static void UnregisterWindow(Window window) Views.Remove(window); } } - - } diff --git a/Riverside.Graphite/MainWindow.xaml.cs b/Riverside.Graphite/MainWindow.xaml.cs index 6fc1a8ef..25e67a85 100644 --- a/Riverside.Graphite/MainWindow.xaml.cs +++ b/Riverside.Graphite/MainWindow.xaml.cs @@ -105,7 +105,6 @@ public MainWindow() foreach (Window win in AppService.FireWindows) { - var obj = new object(); lock (obj) { @@ -1055,14 +1054,14 @@ private void TabMenuClick(object sender, RoutedEventArgs e) { messenger.PromptUserToRateApp().ConfigureAwait(false); } - catch {; } + catch { } break; case "Updated": try { messenger.InstallUpdatesAsync(new FireNotification() { HasInput = false, Originator = "ToolBar" }).ConfigureAwait(false); } - catch {; } + catch { } break; @@ -1427,16 +1426,13 @@ private void UrlBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSugges private void AlphaSearchAsync(Button btn) { - var win = new AlphaFilter(); FlyoutBase.SetAttachedFlyout(btn, win); FlyoutBase.ShowAttachedFlyout(btn); - } private void HistoryDateSearchAsync(Button btn) { - var frm = new Frame(); var fly = new Flyout() { Placement = FlyoutPlacementMode.TopEdgeAlignedLeft }; fly.AllowFocusOnInteraction = true; diff --git a/Riverside.Graphite/Pages/NewTab.xaml.cs b/Riverside.Graphite/Pages/NewTab.xaml.cs index b2350c93..710c1cba 100644 --- a/Riverside.Graphite/Pages/NewTab.xaml.cs +++ b/Riverside.Graphite/Pages/NewTab.xaml.cs @@ -641,12 +641,10 @@ private void FavoritesListView_SelectionChanged(object sender, SelectionChangedE private void SelectBar_Toggled(object sender, RoutedEventArgs e) { UpdateUserSettings(userSettings => userSettings.NewTabSelectorBarVisible = SelectBar.IsOn); - } private void LogoToggle_Toggled(object sender, RoutedEventArgs e) { UpdateUserSettings(userSettings => userSettings.IsLogoVisible = LogoToggle.IsOn); - } } \ No newline at end of file diff --git a/Riverside.Graphite/Pages/SettingsPages/SettingsHome.xaml.cs b/Riverside.Graphite/Pages/SettingsPages/SettingsHome.xaml.cs index 8c21134b..dc937dad 100644 --- a/Riverside.Graphite/Pages/SettingsPages/SettingsHome.xaml.cs +++ b/Riverside.Graphite/Pages/SettingsPages/SettingsHome.xaml.cs @@ -80,7 +80,7 @@ public Task LoadUsernames() UserListView.ItemsSource = filteredUsernames; // Update visibility based on whether there are items - if (filteredUsernames.Any()) + if (filteredUsernames.Count != 0) { UserListView.Visibility = Visibility.Visible; EmptyListMessage.Visibility = Visibility.Collapsed; diff --git a/Riverside.Graphite/Pages/SettingsPages/SettingsNewTab.xaml.cs b/Riverside.Graphite/Pages/SettingsPages/SettingsNewTab.xaml.cs index f2fce493..f1055345 100644 --- a/Riverside.Graphite/Pages/SettingsPages/SettingsNewTab.xaml.cs +++ b/Riverside.Graphite/Pages/SettingsPages/SettingsNewTab.xaml.cs @@ -140,13 +140,11 @@ private Task SaveSettingsAsync() private void SelectbarHome_Toggled(object sender, RoutedEventArgs e) { UpdateAppSetting((ToggleSwitch)sender, value => AppService.AppSettings.NewTabSelectorBarVisible = value); - } private void LogoHome_Toggled(object sender, RoutedEventArgs e) { UpdateAppSetting((ToggleSwitch)sender, value => AppService.AppSettings.IsLogoVisible = value); - } } } \ No newline at end of file diff --git a/Riverside.Graphite/Pages/SettingsPages/SettingsPrivacy.xaml.cs b/Riverside.Graphite/Pages/SettingsPages/SettingsPrivacy.xaml.cs index 9c8f6abe..5bb7f19c 100644 --- a/Riverside.Graphite/Pages/SettingsPages/SettingsPrivacy.xaml.cs +++ b/Riverside.Graphite/Pages/SettingsPages/SettingsPrivacy.xaml.cs @@ -197,7 +197,6 @@ private async Task SavePermissionsToJsonAsync() Directory.CreateDirectory(Path.GetDirectoryName(filePath)); await File.WriteAllTextAsync(filePath, json); - } catch (Exception ex) { diff --git a/Riverside.Graphite/Services/AdBlocker.cs b/Riverside.Graphite/Services/AdBlocker.cs index ebe90d2d..87913246 100644 --- a/Riverside.Graphite/Services/AdBlocker.cs +++ b/Riverside.Graphite/Services/AdBlocker.cs @@ -30,7 +30,6 @@ public void Unregister() _webView.CoreWebView2.NavigationCompleted -= CoreWebView2_NavigationCompleted; _webView.CoreWebView2Initialized -= WebView_CoreWebView2Initialized; } - } public async Task Initialize(WebView2 webView) @@ -87,6 +86,5 @@ public async Task InjectAdBlockingScript() ExceptionLogger.LogException(e); } } - } } diff --git a/Riverside.Graphite/Services/AppService.cs b/Riverside.Graphite/Services/AppService.cs index 94b26716..97f17d7b 100644 --- a/Riverside.Graphite/Services/AppService.cs +++ b/Riverside.Graphite/Services/AppService.cs @@ -524,8 +524,6 @@ private static void ValidateCreatePrivateUser() AuthService.AddUser(newUser); UserFolderManager.CreateUserFolders(newUser); } - - } private static void HideDirectory(string directoryPath) diff --git a/Riverside.Graphite/Services/Notifications/NotificationMessenger.cs b/Riverside.Graphite/Services/Notifications/NotificationMessenger.cs index eda9b092..c6187746 100644 --- a/Riverside.Graphite/Services/Notifications/NotificationMessenger.cs +++ b/Riverside.Graphite/Services/Notifications/NotificationMessenger.cs @@ -65,7 +65,6 @@ public async Task InstallUpdatesAsync(FireNotification notification) // Inform the user that no updates are available window.DispatcherQueue.TryEnqueue(() => window.NotificationQueue.Show("No Updates Available\nYou already have the lastest version of the App", 2000, "Graphite Browser")); - } } diff --git a/Riverside.Graphite/Services/Signalr/HubService.cs b/Riverside.Graphite/Services/Signalr/HubService.cs index 245256c8..42bde28e 100644 --- a/Riverside.Graphite/Services/Signalr/HubService.cs +++ b/Riverside.Graphite/Services/Signalr/HubService.cs @@ -1,4 +1,4 @@ - + using Microsoft.AspNetCore.SignalR.Client; using Microsoft.Extensions.Logging; using Riverside.Graphite.Runtime.Helpers.Logging; @@ -10,7 +10,6 @@ public class HubService { public HubService() { - Initialize(); } private HubConnection _hubConnection; @@ -36,7 +35,5 @@ private async void Initialize() } } //(https://github.com/microsoft/WindowsAppSDK/discussions/3561) - - } } diff --git a/Riverside.Graphite/Services/ViewModels/HomeViewModel.cs b/Riverside.Graphite/Services/ViewModels/HomeViewModel.cs index 0bc4acc7..537885ae 100644 --- a/Riverside.Graphite/Services/ViewModels/HomeViewModel.cs +++ b/Riverside.Graphite/Services/ViewModels/HomeViewModel.cs @@ -231,26 +231,22 @@ public HomeViewModel(IMessenger messenger) [RelayCommand] private void Chat(Button sender) { - try { if (Application.Current is App app && app.m_window is MainWindow window) { window?.NavigateToUrl("http://localhost:5000/"); } - } catch (Exception e) { ExceptionLogger.LogException(e); _ = Messenger.Send(new Message_Settings_Actions("Can't navigate to the requested website", EnumMessageStatus.Informational)); } - } [RelayCommand] private void Logins(Button btn) { - if (Application.Current is App app && app.m_window is MainWindow window) { window.DispatcherQueue?.TryEnqueue(() => diff --git a/Riverside.Graphite/Services/ViewModels/MainWindowViewModel.cs b/Riverside.Graphite/Services/ViewModels/MainWindowViewModel.cs index b9dd07c9..d62f5534 100644 --- a/Riverside.Graphite/Services/ViewModels/MainWindowViewModel.cs +++ b/Riverside.Graphite/Services/ViewModels/MainWindowViewModel.cs @@ -88,11 +88,8 @@ public Task GetActiveWebView() private const string nameof = "Copilot By Graphite"; public Task CopilotExists() { - - if (Windowing.FindWindowsByName(nameof) is List collection) { - if (collection.Count > 0) { foreach (nint winId in collection) @@ -107,8 +104,6 @@ public Task CopilotExists() { Windowing.ShowWindow(winId, Windowing.WindowShowStyle.SW_SHOW); } - - } else continue; @@ -118,14 +113,11 @@ public Task CopilotExists() } return Task.FromResult(false); - } [RelayCommand] private async Task GoCopilotOpen() { - - if (await CopilotExists()) return; @@ -153,7 +145,6 @@ private async Task GoCopilotOpen() e.Handled = true; - }; wndCopilot.Content = web; @@ -177,12 +168,10 @@ private async Task GoCopilotOpen() titleBar.ButtonBackgroundColor = btnColor; titleBar.ButtonInactiveBackgroundColor = btnColor; appWindow.SetPresenter(AppWindowPresenterKind.Overlapped); - } AppService.FireWindows.Add(wndCopilot); Windowing.AnimateWindow(hWnd, 200, Windowing.AW_HOR_NEGATIVE | Windowing.AW_BLEND | Windowing.AW_ACTIVATE); - } [RelayCommand] private async Task LogOut() @@ -260,7 +249,6 @@ private void MsOptionsWeb(FrameworkElement sender) [RelayCommand] private void RefreshHistory() { - MainView.FetchBrowserHistory(); } @@ -286,7 +274,6 @@ private LinearGradientBrush CreateAndApplyGradientBrush() [RelayCommand(CanExecute = nameof(IsMsLogin))] private void ShowOfficeOptions(Button sender) { - FlyoutBase.SetAttachedFlyout(sender, MainView.MsLoggedInOptions); FlyoutBase.ShowAttachedFlyout(sender); } @@ -372,5 +359,4 @@ public void RaisePropertyChanges([CallerMemberName] string? propertyName = null) { OnPropertyChanged(propertyName); } - } \ No newline at end of file diff --git a/Riverside.Graphite/Services/ViewModels/UC_Viewmodel.cs b/Riverside.Graphite/Services/ViewModels/UC_Viewmodel.cs index 8c582000..7c4f22fd 100644 --- a/Riverside.Graphite/Services/ViewModels/UC_Viewmodel.cs +++ b/Riverside.Graphite/Services/ViewModels/UC_Viewmodel.cs @@ -94,7 +94,6 @@ private async Task LoginToMicrosoft() MsProfilePicture = bitmapImage; RaisePropertyChanges(nameof(MsProfilePicture)); RaisePropertyChanges(nameof(IsLoggedIn)); - } else {