From befae52c09218083f51b1b99beef90af5612f742 Mon Sep 17 00:00:00 2001
From: Robin Ward <robin.ward@gmail.com>
Date: Mon, 8 Feb 2016 13:40:52 -0500
Subject: [PATCH] FIX: Read post icon was not fading

---
 .../javascripts/discourse/controllers/topic.js.es6 | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6
index 7f91beeb1..8a7548bc0 100644
--- a/app/assets/javascripts/discourse/controllers/topic.js.es6
+++ b/app/assets/javascripts/discourse/controllers/topic.js.es6
@@ -715,14 +715,16 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
   },
 
   readPosts(topicId, postNumbers) {
-    const topic = this.get("model"),
-          postStream = topic.get("postStream");
+    const topic = this.get("model");
+    const postStream = topic.get("postStream");
+
+    if (topic.get('id') === topicId) {
 
-    if (topic.get("id") === topicId) {
       // TODO identity map for postNumber
-      _.each(postStream.get('posts'), post => {
-        if (_.include(postNumbers, post.post_number) && !post.read) {
-          post.set("read", true);
+      postStream.get('posts').forEach(post => {
+        if (!post.read && postNumbers.indexOf(post.post_number) !== -1) {
+          post.set('read', true);
+          this.appEvents.trigger('post-stream:refresh', post.id);
         }
       });