app/jobs/stream_notifications_job.rb in hyrax-2.0.0.beta2 vs app/jobs/stream_notifications_job.rb in hyrax-2.0.0.beta3
- old
+ new
@@ -1,6 +1,8 @@
class StreamNotificationsJob < Hyrax::ApplicationJob
def perform(users)
+ # Do not use the ActionCable machinery if the feature is disabled
+ return unless Hyrax.config.realtime_notifications?
Array.wrap(users).each do |user|
mailbox = UserMailbox.new(user)
Hyrax::NotificationsChannel.broadcast_to(user,
notifications_count: mailbox.unread_count,
notifications_label: mailbox.label)