bring in unread items to "latest" as well as new items.

This commit is contained in:
Sam 2013-06-11 15:51:43 +10:00
parent 4d7a520a8c
commit 6d85dc1724
2 changed files with 6 additions and 1 deletions

View File

@ -58,6 +58,11 @@ Discourse.TopicList = Discourse.Model.extend({
var _this = this;
var topics = this.get('topics');
// refresh dupes
topics.removeObjects(topics.filter(function(topic){
return topic_ids.indexOf(topic.get('id')) >= 0;
}));
Discourse.TopicList.loadTopics(topic_ids, this.get('filter'))
.then(function(newTopics){
_this.forEachNew(newTopics, function(t) {

View File

@ -46,7 +46,7 @@ Discourse.TopicTrackingState = Discourse.Model.extend({
if ((this.filter === "all" ||this.filter === "latest" || this.filter === "new") && data.message_type === "new_topic" ) {
this.newIncoming.push(data.topic_id);
}
if ((this.filter === "all" || this.filter === "unread") && data.message_type === "unread") {
if ((this.filter === "all" ||this.filter === "latest" || this.filter === "unread") && data.message_type === "unread") {
var old = this.states["t" + data.topic_id];
if(!old) {
this.newIncoming.push(data.topic_id);