@@ -358,7 +358,7 @@ def json_safe_and_pretty(hash_or_string)
358358 # second parameter passed to both component and store Render-Functions.
359359 # This method can be called from views and from the controller, as `helpers.rails_context`
360360 #
361- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
361+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
362362 def rails_context ( server_side : true )
363363 # ALERT: Keep in sync with node_package/src/types/index.ts for the properties of RailsContext
364364 @rails_context ||= begin
@@ -376,10 +376,12 @@ def rails_context(server_side: true)
376376 rorVersion : ReactOnRails ::VERSION ,
377377 # TODO: v13 just use the version if existing
378378 rorPro : ReactOnRails ::Utils . react_on_rails_pro? ,
379- rscPayloadGenerationUrl : rsc_url
380379 }
380+
381381 if ReactOnRails ::Utils . react_on_rails_pro?
382382 result [ :rorProVersion ] = ReactOnRails ::Utils . react_on_rails_pro_version
383+
384+ result [ :rscPayloadGenerationUrl ] = rsc_url if ReactOnRailsPro . configuration . enable_rsc_support
383385 end
384386
385387 if defined? ( request ) && request . present?
@@ -437,7 +439,7 @@ def load_pack_for_generated_component(react_component_name, render_options)
437439 append_stylesheet_pack_tag ( "generated/#{ react_component_name } " )
438440 end
439441
440- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
442+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
441443
442444 private
443445
0 commit comments