mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-30 23:01:05 -05:00
Use favicon-notify for unread notifications
I actually made favicon-notify around 4 years ago, even predating when we moved to Git for the client repo. Unfortunately, at the time, a Chrome bug made it not work, so I gave up on it back then and decided web notifications would be enough. I've missed enough notifications to know that having both would be better, and all the relevant browser bugs have been fixed so this can be implemented the easy way.
This commit is contained in:
@@ -130,6 +130,17 @@
|
||||
}
|
||||
if (window.nodewebkit) {
|
||||
if (nwWindow.setBadgeLabel) nwWindow.setBadgeLabel(notificationCount || '');
|
||||
} else {
|
||||
var $favicon = $('#dynamic-favicon');
|
||||
if (!!$favicon.data('on') !== !!notificationCount) {
|
||||
if (notificationCount) {
|
||||
$favicon.attr('href', Tools.resourcePrefix + '/favicon-notify.ico');
|
||||
$favicon.data('on', '1');
|
||||
} else {
|
||||
$favicon.attr('href', Tools.resourcePrefix + '/favicon.ico');
|
||||
$favicon.data('on', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
sideBuf += this.renderRoomTab(app.rooms['rooms'], 'rooms');
|
||||
var margin = 0;
|
||||
|
||||
Reference in New Issue
Block a user