From 3879e07e46362a3d225f0bda1d1a5780ebc0d892 Mon Sep 17 00:00:00 2001 From: Tor Hveem <tor@hveem.no> Date: Wed, 22 Jan 2014 11:32:08 +0100 Subject: [PATCH] Fix Favico --- js/websockets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/websockets.js b/js/websockets.js index 437019d..9777a78 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -500,14 +500,14 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.showNicklist = $scope.updateShowNicklist(); }); $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 ) { $scope.favico = new Favico({ animation:'none' }); $scope.favico.badge(notifications); }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({ animation:'none', bgColor : '#5CB85C',