Skip to content

Commit

Permalink
perf: svg loading improvements (#3470)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev authored Nov 28, 2024
1 parent 0701eff commit 2b46f8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/avo/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def svg(file_name, **args)

file_name = "#{file_name}.svg" unless file_name.end_with? ".svg"

with_asset_finder(::Avo::SvgFinder) do
Avo::CACHED_SVGS[file_name] ||= with_asset_finder(::Avo::SvgFinder) do
inline_svg file_name, **args
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/avo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module Avo
COOKIES_KEY = "avo"
MODAL_FRAME_ID = :modal_frame
ACTIONS_BACKGROUND_FRAME = :actions_background
CACHED_SVGS = {}

class LicenseVerificationTemperedError < StandardError; end

Expand Down

0 comments on commit 2b46f8f

Please sign in to comment.