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.
This commit is contained in:
Rafael dos Santos Silva 2020-10-08 20:51:39 -03:00 committed by GitHub
parent 4a8f5dbfbd
commit 5157e3b6e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,7 @@ export default Service.extend({
this.notificationCount = 0;
}
this.appEvents.trigger("discourse:focus-changed", session.hasFocus);
this._renderFavicon();
this._renderTitle();
},