From 5157e3b6e3c0253314be428f98b9f5f65bcb361e Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Thu, 8 Oct 2020 20:51:39 -0300 Subject: [PATCH] FIX: Favicon count was not updated when window focus returned (#10875) This misses a test because Favcount doesn't exposes a get to the counter. Also, since this code deals with all possible notifications configs we support: - favicon notification - favicon new content - title notification - title new content the code is a bit complicated to follow. We may look into refactoring it when a good opportunity arises, like if https://w3c.github.io/badging/ setClientBadge() method gives us a cleaner way to notify users. --- app/assets/javascripts/discourse/app/services/document-title.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/discourse/app/services/document-title.js b/app/assets/javascripts/discourse/app/services/document-title.js index 709b5e3664a..944940c0988 100644 --- a/app/assets/javascripts/discourse/app/services/document-title.js +++ b/app/assets/javascripts/discourse/app/services/document-title.js @@ -44,6 +44,7 @@ export default Service.extend({ this.notificationCount = 0; } this.appEvents.trigger("discourse:focus-changed", session.hasFocus); + this._renderFavicon(); this._renderTitle(); },