diff --git a/app/helpers/avo/application_helper.rb b/app/helpers/avo/application_helper.rb index d3bc0f216..af231f14b 100644 --- a/app/helpers/avo/application_helper.rb +++ b/app/helpers/avo/application_helper.rb @@ -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 diff --git a/lib/avo.rb b/lib/avo.rb index d2bb5de06..58aa29743 100644 --- a/lib/avo.rb +++ b/lib/avo.rb @@ -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