Fix message after subscription confirmation for Async adapter
Amends 2c46ad2c
This commit is contained in:
@ -2,14 +2,12 @@
|
|||||||
|
|
||||||
module ApplicationCable
|
module ApplicationCable
|
||||||
class Channel < ActionCable::Channel::Base
|
class Channel < ActionCable::Channel::Base
|
||||||
@streaming_confirmation_callback = -> {}
|
|
||||||
|
|
||||||
def ensure_confirmation_sent
|
def ensure_confirmation_sent
|
||||||
# Currently, we are required to overwrite this ActionCable method.
|
# Currently, we are required to overwrite this ActionCable method.
|
||||||
# Once called and the subscription confirmation is sent, we call the custom callback.
|
# Once called and the subscription confirmation is sent, we call the custom callback.
|
||||||
# See https://github.com/rails/rails/issues/25333.
|
# See https://github.com/rails/rails/issues/25333.
|
||||||
super
|
super
|
||||||
@streaming_confirmation_callback.call if subscription_confirmation_sent?
|
@streaming_confirmation_callback.call if subscription_confirmation_sent? && @streaming_confirmation_callback.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_after_streaming_confirmed(&block)
|
def send_after_streaming_confirmed(&block)
|
||||||
|
Reference in New Issue
Block a user