add comments

This commit is contained in:
Ryan Peters 2023-03-10 03:14:28 +00:00
parent b89a557af1
commit c9f22e0978

View File

@ -25,11 +25,13 @@ namespace BinaryDad.Notes
{ {
noteService.Save(content, noteName); noteService.Save(content, noteName);
// find all other connections except for the current one
var clientConnections = NoteContext.ClientNotes var clientConnections = NoteContext.ClientNotes
.Where(c => c.Value == noteName && c.Key != Context.ConnectionId) .Where(c => c.Value == noteName && c.Key != Context.ConnectionId)
.Select(c => c.Key) .Select(c => c.Key)
.ToList(); .ToList();
// update note for all other clients
await Clients await Clients
.Clients(clientConnections) .Clients(clientConnections)
.SendAsync("updateNote", content); .SendAsync("updateNote", content);