From 0d7cfcf37672a4518a210bee56b9175f653b6f80 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Fri, 11 Oct 2013 22:43:01 +0200 Subject: [PATCH] Fix problem with activity switch --- js/websockets.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/websockets.js b/js/websockets.js index f2e1f59..30d2b98 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -498,16 +498,16 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $rootScope.switchToActivityBuffer = function() { // Find next buffer with activity and switch to it - angular.forEach($scope.buffers, function(buffer) { + for(i in $scope.buffers) { + var buffer = $scope.buffers[i]; if(buffer.notification) { $scope.setActiveBuffer(buffer.id); - return false; + break; }else if((parseInt(buffer.unread) || 0) > 0) { $scope.setActiveBuffer(buffer.id); - return false; + break; } - return true; - }); + } } $scope.handleKeyPress = function($event) {