Update Notification Refactor (#511)

* Replaced profile links to anchors so we can open in new tab if we like

* Refactored how update checking works. We now explicitly check and send back on the same API. We have a weekly job that will push an update to the user.

* Implemented a changelog tab

* Ported over a GA fix for using ' in PR bodies.

* Don't check cert for Github
This commit is contained in:
Joseph Milazzo 2021-08-19 16:49:53 -07:00 committed by GitHub
parent 0e48aeebc5
commit 2a76092566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 246 additions and 56 deletions

View file

@ -7,27 +7,30 @@ using Microsoft.AspNetCore.SignalR;
namespace API.SignalR
{
/// <summary>
/// Generic hub for sending messages to UI
/// </summary>
[Authorize]
public class MessageHub : Hub
{
private static readonly HashSet<string> _connections = new HashSet<string>();
private static readonly HashSet<string> Connections = new HashSet<string>();
public static bool IsConnected
{
get
{
lock (_connections)
lock (Connections)
{
return _connections.Count != 0;
return Connections.Count != 0;
}
}
}
public override async Task OnConnectedAsync()
{
lock (_connections)
lock (Connections)
{
_connections.Add(Context.ConnectionId);
Connections.Add(Context.ConnectionId);
}
await base.OnConnectedAsync();
@ -35,9 +38,9 @@ namespace API.SignalR
public override async Task OnDisconnectedAsync(Exception exception)
{
lock (_connections)
lock (Connections)
{
_connections.Remove(Context.ConnectionId);
Connections.Remove(Context.ConnectionId);
}
await base.OnDisconnectedAsync(exception);