Skip to content

A platform for community discussion. Free, open, simple.

DEV: ensures __optInput is initialized (#21886)

Joffrey JAFFEUX7130047bd83a
diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb
index 4a668a30bfc..b711e404576 100644
--- a/lib/pretty_text.rb
+++ b/lib/pretty_text.rb
@@ -257,6 +257,8 @@ module PrettyText
# leaving this here, cause it invokes v8, don't want to implement twice
def self.avatar_img(avatar_template, size)
protect { v8.eval(<<~JS) }
+ __optInput = {};
+ __optInput.avatar_sizes = #{SiteSetting.avatar_sizes.to_json};
__paths = #{paths_json};
__utils.avatarImg({size: #{size.inspect}, avatarTemplate: #{avatar_template.inspect}}, __getURL);
JS