Skip to content

Commit

Permalink
Update user_notification_channel.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
giftade authored Sep 15, 2022
1 parent 3a9b53f commit f083e14
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/channels/user_notification_channel.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit f083e14

Please sign in to comment.