diff --git a/app/channels/user_notification_channel.rb b/app/channels/user_notification_channel.rb index 04415cb27c..7e598e0797 100644 --- a/app/channels/user_notification_channel.rb +++ b/app/channels/user_notification_channel.rb @@ -1,11 +1,12 @@ class UserNotificationChannel < ApplicationCable::Channel - def subscribed - if !current_user.nil? - stream_from "users:notification:#{current_user.id}" - else + def subscribed + if current_user.nil? reject + else + stream_from "users:notification:#{current_user.id}" end end + def unsubscribed # Any cleanup needed when channel is unsubscribed