attempt to fix notifications for ConsumableMappingAdded

it didnt work
This commit is contained in:
Lapis
2026-04-05 11:52:27 -04:00
parent 4004bdb1b9
commit ceda1be433
8 changed files with 476 additions and 154 deletions
+10 -1
View File
@@ -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;
}
}