class NotificationsChannel < ApplicationCable::Channel
  def subscribed
    stream_from "notifications_channel_#{current_user.id}"
    current_user.send_unread_pan_count
    current_user.update(online: true)
  end

  def unsubscribed
    current_user.update(online: false)
  end
end
