REFACTOR: Remove `_.chain`

REFACTOR: Remove _.chain

diff --git a/app/assets/javascripts/admin/routes/admin-backups-logs.js b/app/assets/javascripts/admin/routes/admin-backups-logs.js
index 2c7e16e..2535a73 100644
--- a/app/assets/javascripts/admin/routes/admin-backups-logs.js
+++ b/app/assets/javascripts/admin/routes/admin-backups-logs.js
@@ -12,14 +12,11 @@ export default Route.extend({
       if (preloadedLogs && preloadedLogs.length) {
         // we need to filter out message like: "[SUCCESS]"
         // and convert POJOs to Ember Objects
-        const newLogs = _.chain(preloadedLogs)
-          .reject(function(log) {
-            return log.message.length === 0 || log.message[0] === "[";
+        const newLogs = preloadedLogs
+          .filter(log => {
+            return log.message.length > 0 && log.message[0] !== "[";
           })
-          .map(function(log) {
-            return EmberObject.create(log);
-          })
-          .value();
+          .map(log => EmberObject.create(log));
         logs.pushObjects(newLogs);
       }
     });
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 a2ce7c6..7b98945 100644
--- a/app/assets/javascripts/discourse/app/models/topic-tracking-state.js
+++ b/app/assets/javascripts/discourse/app/models/topic-tracking-state.js
@@ -429,19 +429,19 @@ const TopicTrackingState = EmberObject.extend({
     const subcategoryIds = this.getSubCategoryIds(categoryId);
     const mutedCategoryIds =
       this.currentUser && this.currentUser.muted_category_ids;
-    return _.chain(this.states)
-      .filter(type === "new" ? isNew : isUnread)
-      .filter(
-        topic =>
-          topic.archetype !== "private_message" &&
-          !topic.deleted &&
-          (!categoryId || subcategoryIds.has(topic.category_id)) &&
-          (!tagId || (topic.tags && topic.tags.indexOf(tagId) > -1)) &&
-          (type !== "new" ||
-            !mutedCategoryIds ||
-            mutedCategoryIds.indexOf(topic.category_id) === -1)
-      )
-      .value().length;
+    let filter = type === "new" ? isNew : isUnread;
+
+    return Object.values(this.states).filter(
+      topic =>
+        filter(topic) &&
+        topic.archetype !== "private_message" &&
+        !topic.deleted &&
+        (!categoryId || subcategoryIds.has(topic.category_id)) &&
+        (!tagId || (topic.tags && topic.tags.indexOf(tagId) > -1)) &&
+        (type !== "new" ||
+          !mutedCategoryIds ||
+          mutedCategoryIds.indexOf(topic.category_id) === -1)
+    ).length;
   },
 
   countNew(categoryId, tagId) {

GitHub sha: d06deb0c

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