mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
20 lines
422 B
Ruby
20 lines
422 B
Ruby
# frozen_string_literal: true
|
|
|
|
class FamilyLocationsChannel < ApplicationCable::Channel
|
|
def subscribed
|
|
return reject unless family_feature_enabled?
|
|
return reject unless current_user.in_family?
|
|
|
|
stream_for current_user.family
|
|
end
|
|
|
|
def unsubscribed
|
|
# Any cleanup needed when channel is unsubscribed
|
|
end
|
|
|
|
private
|
|
|
|
def family_feature_enabled?
|
|
DawarichSettings.family_feature_enabled?
|
|
end
|
|
end
|