From 22bdb71ecce29445f47fdd85a09633315c670b1c Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Wed, 13 Sep 2023 17:28:14 +0200 Subject: [PATCH] Fix message after subscription confirmation for Async adapter Amends 2c46ad2c --- app/channels/application_cable/channel.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb index c02f7466..b2939137 100644 --- a/app/channels/application_cable/channel.rb +++ b/app/channels/application_cable/channel.rb @@ -2,14 +2,12 @@ module ApplicationCable class Channel < ActionCable::Channel::Base - @streaming_confirmation_callback = -> {} - def ensure_confirmation_sent # Currently, we are required to overwrite this ActionCable method. # Once called and the subscription confirmation is sent, we call the custom callback. # See https://github.com/rails/rails/issues/25333. super - @streaming_confirmation_callback.call if subscription_confirmation_sent? + @streaming_confirmation_callback.call if subscription_confirmation_sent? && @streaming_confirmation_callback.present? end def send_after_streaming_confirmed(&block)