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:
Guangcong Luo
2016-04-09 06:21:07 -04:00
parent e021767e58
commit f530874dc0

View File

@@ -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;