mirror of
https://github.com/CannedNet/CannedNet.git
synced 2026-10-26 23:48:58 -07:00
attempt to fix notifications for ConsumableMappingAdded
it didnt work
This commit is contained in:
@@ -28,7 +28,11 @@ public class NotificationsHub : Hub
|
||||
|
||||
public async Task SubscribeToPlayers(SubscriptionList subscriptionList)
|
||||
{
|
||||
await _notificationService.SubscribeToPlayers(Context.ConnectionId, subscriptionList);
|
||||
var hubContext = GetService<IHubContext<NotificationsHub>>();
|
||||
if (hubContext != null)
|
||||
{
|
||||
await _notificationService.SubscribeToPlayers(Context.ConnectionId, subscriptionList, hubContext);
|
||||
}
|
||||
}
|
||||
|
||||
public Task<HashSet<int>> GetSubscriptions()
|
||||
@@ -40,4 +44,9 @@ public class NotificationsHub : Hub
|
||||
{
|
||||
return _notificationService;
|
||||
}
|
||||
|
||||
private T? GetService<T>() where T : class
|
||||
{
|
||||
return Context.GetHttpContext()?.RequestServices.GetService(typeof(T)) as T;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user