REFACTOR: Remove `Discourse.SiteSettings` from text helpers

REFACTOR: Remove Discourse.SiteSettings from text helpers

diff --git a/app/assets/javascripts/discourse-common/addon/lib/helpers.js b/app/assets/javascripts/discourse-common/addon/lib/helpers.js
index 48a64fd..826a585 100644
--- a/app/assets/javascripts/discourse-common/addon/lib/helpers.js
+++ b/app/assets/javascripts/discourse-common/addon/lib/helpers.js
@@ -52,6 +52,8 @@ export function createHelperContext(siteSettings) {
   };
 }
 
+// This can be used by a helper to get the SiteSettings. Note you should not
+// be using it outside of helpers (or lib code that helpers use!)
 export function helperContext() {
   return _helperContext;
 }
diff --git a/app/assets/javascripts/discourse/app/lib/text.js b/app/assets/javascripts/discourse/app/lib/text.js
index a6d5bf2..9cf0103 100644
--- a/app/assets/javascripts/discourse/app/lib/text.js
+++ b/app/assets/javascripts/discourse/app/lib/text.js
@@ -7,6 +7,7 @@ import loadScript from "discourse/lib/load-script";
 import { formatUsername } from "discourse/lib/utilities";
 import { Promise } from "rsvp";
 import { htmlSafe } from "@ember/template";
+import { helperContext } from "discourse-common/lib/helpers";
 
 function getOpts(opts) {
   const siteSettings = Discourse.__container__.lookup("site-settings:main"),
@@ -73,15 +74,16 @@ function createPrettyText(options) {
 }
 
 function emojiOptions() {
-  if (!Discourse.SiteSettings.enable_emoji) {
+  let siteSettings = helperContext().siteSettings;
+  if (!siteSettings.enable_emoji) {
     return;
   }
 
   return {
     getURL: url => getURLWithCDN(url),
-    emojiSet: Discourse.SiteSettings.emoji_set,
-    enableEmojiShortcuts: Discourse.SiteSettings.enable_emoji_shortcuts,
-    inlineEmoji: Discourse.SiteSettings.enable_inline_emoji_translation
+    emojiSet: siteSettings.emoji_set,
+    enableEmojiShortcuts: siteSettings.enable_emoji_shortcuts,
+    inlineEmoji: siteSettings.enable_inline_emoji_translation
   };
 }
 

GitHub sha: 02132110