Skip to content

Commit

Permalink
fix(components): fix useless assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
allmarkedup committed Sep 6, 2022
1 parent 47f4740 commit 4bf9493
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/lookbook/base_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ def alpine_encode(data)
if data.is_a? String
"\'#{json_escape data}\'"
else
json_escape data.to_json.gsub("\"", "\'")
json_escape data.to_json.tr("\"", "\'")
end
end

def prepare_alpine_data(x_data = nil)
alpine_component_name = x_data || @html_attrs&.dig(:"x-data") || alpine_component
if alpine_component_name.present?
args = Array.wrap(alpine_data).compact
func = args.any? ? "#{alpine_component_name}(#{args.join(",")})" : alpine_component_name
args.any? ? "#{alpine_component_name}(#{args.join(",")})" : alpine_component_name
end
end
end
Expand Down

0 comments on commit 4bf9493

Please sign in to comment.