diff --git a/app/assets/javascripts/discourse/models/nav_item.js b/app/assets/javascripts/discourse/models/nav_item.js index 18571d2de..0ea27df11 100644 --- a/app/assets/javascripts/discourse/models/nav_item.js +++ b/app/assets/javascripts/discourse/models/nav_item.js @@ -12,7 +12,13 @@ Discourse.NavItem = Discourse.Model.extend({ displayName: function() { var categoryName = this.get('categoryName'), name = this.get('name'), - extra = { count: this.get('count') || 0 }; + count = this.get('count') || 0; + + if (name === 'latest' && !Discourse.Mobile.mobileView) { + count = 0; + } + + var extra = { count: count }; if (categoryName) { name = 'category'; diff --git a/app/assets/javascripts/discourse/models/topic-tracking-state.js.es6 b/app/assets/javascripts/discourse/models/topic-tracking-state.js.es6 index 036fac5a6..051a7b032 100644 --- a/app/assets/javascripts/discourse/models/topic-tracking-state.js.es6 +++ b/app/assets/javascripts/discourse/models/topic-tracking-state.js.es6 @@ -266,6 +266,12 @@ const TopicTrackingState = Discourse.Model.extend({ }, lookupCount(name, category){ + + if (name === "latest") { + return this.lookupCount("new", category) + + this.lookupCount("unread", category); + } + let categoryName = category ? Em.get(category, "name") : null; if(name === "new") { return this.countNew(categoryName); @@ -278,6 +284,7 @@ const TopicTrackingState = Discourse.Model.extend({ } } }, + loadStates(data) { // not exposed const states = this.states; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 6d49c48c0..8736a0397 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1567,7 +1567,10 @@ en: with_topics: "%{filter} topics" with_category: "%{filter} %{category} topics" latest: - title: "Latest" + title: + zero: "Latest" + one: "Latest (1)" + other: "Latest ({{count}})" help: "topics with recent posts" hot: title: "Hot"