diff --git a/app/assets/javascripts/discourse.js.es6 b/app/assets/javascripts/discourse.js.es6 index ef6bbe574e..b1784a9bac 100644 --- a/app/assets/javascripts/discourse.js.es6 +++ b/app/assets/javascripts/discourse.js.es6 @@ -51,12 +51,7 @@ const Discourse = Ember.Application.extend({ $("title").text(title); } - var displayCount = - Discourse.User.current() && - Discourse.User.currentProp("title_count_mode") === "notifications" - ? this.get("notificationCount") - : this.get("contextCount"); - + var displayCount = this.get("displayCount"); if (displayCount > 0 && !Discourse.User.currentProp("dynamic_favicon")) { title = `(${displayCount}) ${title}`; } @@ -64,6 +59,14 @@ const Discourse = Ember.Application.extend({ document.title = title; }, + @computed("contextCount", "notificationCount") + displayCount() { + return Discourse.User.current() && + Discourse.User.currentProp("title_count_mode") === "notifications" + ? this.get("notificationCount") + : this.get("contextCount"); + }, + @observes("contextCount", "notificationCount") faviconChanged() { if (Discourse.User.currentProp("dynamic_favicon")) { @@ -76,9 +79,7 @@ const Discourse = Ember.Application.extend({ url = Discourse.getURL("/favicon/proxied?" + encodeURIComponent(url)); } - var displayCount = Discourse.User.current() - ? this.get("notificationCount") - : this.get("contextCount"); + var displayCount = this.get("displayCount"); new window.Favcount(url).set(displayCount); } diff --git a/app/assets/javascripts/discourse/templates/preferences/interface.hbs b/app/assets/javascripts/discourse/templates/preferences/interface.hbs index 61f1303c27..e1192d127d 100644 --- a/app/assets/javascripts/discourse/templates/preferences/interface.hbs +++ b/app/assets/javascripts/discourse/templates/preferences/interface.hbs @@ -49,7 +49,6 @@ {{preference-checkbox labelKey="user.external_links_in_new_tab" checked=model.user_option.external_links_in_new_tab}} {{preference-checkbox labelKey="user.enable_quoting" checked=model.user_option.enable_quoting}} - {{preference-checkbox labelKey="user.dynamic_favicon" checked=model.user_option.dynamic_favicon}} {{#if siteSettings.automatically_unpin_topics}} {{preference-checkbox labelKey="user.automatically_unpin_topics" checked=model.user_option.automatically_unpin_topics}} {{/if}} @@ -57,6 +56,7 @@ {{#if isiPad}} {{preference-checkbox labelKey="user.enable_physical_keyboard" checked=disableSafariHacks}} {{/if}} + {{preference-checkbox labelKey="user.dynamic_favicon" checked=model.user_option.dynamic_favicon}}