From ad9b93c5b78e530869f6edf637420d7acb48d8b1 Mon Sep 17 00:00:00 2001 From: Abanoub Ghadban Date: Thu, 29 Aug 2024 13:46:24 +0300 Subject: [PATCH] linting --- lib/react_on_rails/helper.rb | 14 ++++++-------- .../react_component/render_options.rb | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/react_on_rails/helper.rb b/lib/react_on_rails/helper.rb index a93485c8d..df0dcf1cc 100644 --- a/lib/react_on_rails/helper.rb +++ b/lib/react_on_rails/helper.rb @@ -581,8 +581,8 @@ def raise_prerender_error(json_result, react_component_name, props, js_code) end def should_raise_streaming_prerender_error?(chunk_json_result, render_options) - chunk_json_result["hasErrors"] && - ((render_options.raise_on_prerender_error && !chunk_json_result["isShellReady"]) || + chunk_json_result["hasErrors"] && + ((render_options.raise_on_prerender_error && !chunk_json_result["isShellReady"]) || (render_options.raise_non_shell_server_rendering_errors && chunk_json_result["isShellReady"])) end @@ -638,15 +638,13 @@ def server_rendered_react_component(render_options) if should_raise_streaming_prerender_error?(chunk_json_result, render_options) raise_prerender_error(chunk_json_result, react_component_name, props, js_code) end - # It doesn't make any transformation, it listens to the streamed chunks and raise error if it has errors + # It doesn't make any transformation, it listens to the streamed chunks and raise error if it has errors chunk_json_result end - else - if result["hasErrors"] && render_options.raise_on_prerender_error - raise_prerender_error(result, react_component_name, props, js_code) - end + elsif result["hasErrors"] && render_options.raise_on_prerender_error + raise_prerender_error(result, react_component_name, props, js_code) end - + result end diff --git a/lib/react_on_rails/react_component/render_options.rb b/lib/react_on_rails/react_component/render_options.rb index 97b61e86a..f93ba85c2 100644 --- a/lib/react_on_rails/react_component/render_options.rb +++ b/lib/react_on_rails/react_component/render_options.rb @@ -136,6 +136,7 @@ def retrieve_configuration_value_for(key) def retrieve_react_on_rails_pro_config_value_for(key) options.fetch(key) do return nil unless ReactOnRails::Utils.react_on_rails_pro? + ReactOnRailsPro.configuration.public_send(key) end end