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