FIX: Read post icon was not fading

This commit is contained in:
Robin Ward 2016-02-08 13:40:52 -05:00
parent c76e6e173e
commit befae52c09
1 changed files with 8 additions and 6 deletions

View File

@ -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);
}
});