Fix Favico

This commit is contained in:
Tor Hveem 2014-01-22 11:32:08 +01:00
parent 15995bde92
commit 3879e07e46
1 changed files with 2 additions and 2 deletions

View File

@ -500,14 +500,14 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$scope.showNicklist = $scope.updateShowNicklist(); $scope.showNicklist = $scope.updateShowNicklist();
}); });
$rootScope.$on('notificationChanged', function() { $rootScope.$on('notificationChanged', function() {
var notifications = _.reduce(models.model.buffers, function(memo, num) { return (memo||0) + num.notification;}); var notifications = _.reduce(models.model.buffers, function(memo, num) { return (parseInt(memo)||0) + num.notification;});
if (notifications > 0 ) { if (notifications > 0 ) {
$scope.favico = new Favico({ $scope.favico = new Favico({
animation:'none' animation:'none'
}); });
$scope.favico.badge(notifications); $scope.favico.badge(notifications);
}else { }else {
var unread = _.reduce(models.model.buffers, function(memo, num) { return (memo||0) + num.unread;}); var unread = _.reduce(models.model.buffers, function(memo, num) { return (parseInt(memo)||0) + num.unread;});
$scope.favico = new Favico({ $scope.favico = new Favico({
animation:'none', animation:'none',
bgColor : '#5CB85C', bgColor : '#5CB85C',