From d4a52189226cec890e6aa321bc2919734552c01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Fri, 21 Feb 2014 16:03:35 +0000 Subject: [PATCH] Fix "Switch to buffer with activity" skipping buffers with notifications This caused two buffer switches in a row, in effect forgetting the notifications --- js/glowingbear.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 8b075e8..94c8db4 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -832,7 +832,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', buffer = sortedBuffers[i]; if (buffer.notification > 0) { $scope.setActiveBuffer(buffer.id); - break; + return; // return instead of break so that the second for loop isn't executed } } // No notifications, find first buffer with unread lines instead @@ -840,7 +840,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', buffer = sortedBuffers[i]; if (buffer.unread > 0) { $scope.setActiveBuffer(buffer.id); - break; + return; } } };