REFACTOR: Remove `Discourse.SiteSettings` from topic tracking state

REFACTOR: Remove Discourse.SiteSettings from topic tracking state

diff --git a/app/assets/javascripts/discourse/app/models/topic-tracking-state.js b/app/assets/javascripts/discourse/app/models/topic-tracking-state.js
index d7d8be5..014b176 100644
--- a/app/assets/javascripts/discourse/app/models/topic-tracking-state.js
+++ b/app/assets/javascripts/discourse/app/models/topic-tracking-state.js
@@ -27,14 +27,14 @@ function isUnseen(topic) {
   return !topic.is_seen;
 }
 
-function hasMutedTags(topicTagIds, mutedTagIds) {
+function hasMutedTags(topicTagIds, mutedTagIds, siteSettings) {
   if (!mutedTagIds || !topicTagIds) {
     return false;
   }
   return (
-    (Discourse.SiteSettings.remove_muted_tags_from_latest === "always" &&
+    (siteSettings.remove_muted_tags_from_latest === "always" &&
       topicTagIds.any(tagId => mutedTagIds.includes(tagId))) ||
-    (Discourse.SiteSettings.remove_muted_tags_from_latest === "only_muted" &&
+    (siteSettings.remove_muted_tags_from_latest === "only_muted" &&
       topicTagIds.every(tagId => mutedTagIds.includes(tagId)))
   );
 }
@@ -81,7 +81,13 @@ const TopicTrackingState = EmberObject.extend({
 
       if (["new_topic", "latest"].includes(data.message_type)) {
         const mutedTagIds = User.currentProp("muted_tag_ids");
-        if (hasMutedTags(data.payload.topic_tag_ids, mutedTagIds)) {
+        if (
+          hasMutedTags(
+            data.payload.topic_tag_ids,
+            mutedTagIds,
+            this.siteSettings
+          )
+        ) {
           return;
         }
       }
diff --git a/app/assets/javascripts/discourse/app/pre-initializers/inject-discourse-objects.js b/app/assets/javascripts/discourse/app/pre-initializers/inject-discourse-objects.js
index 784759e..fe6c7b6 100644
--- a/app/assets/javascripts/discourse/app/pre-initializers/inject-discourse-objects.js
+++ b/app/assets/javascripts/discourse/app/pre-initializers/inject-discourse-objects.js
@@ -47,6 +47,7 @@ export default {
 
     const topicTrackingState = TopicTrackingState.create({
       messageBus: MessageBus,
+      siteSettings,
       currentUser
     });
     app.register("topic-tracking-state:main", topicTrackingState, {

GitHub sha: 531793e9

This commit appears in #10280 which was merged by eviltrout.