Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
AbanoubGhadban committed Aug 29, 2024
1 parent a0fa564 commit 572dc4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/react_on_rails/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,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

Expand Down Expand Up @@ -594,15 +594,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

Expand Down
1 change: 1 addition & 0 deletions lib/react_on_rails/react_component/render_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,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
Expand Down

0 comments on commit 572dc4d

Please sign in to comment.