Merge pull request #170 from lorenzhs/fixactivityswitch

Fix "Switch to buffer with activity" skipping buffers with notifications
This commit is contained in:
David Cormier 2014-02-21 13:49:23 -05:00
commit efda3d4963

View file

@ -887,7 +887,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
buffer = sortedBuffers[i]; buffer = sortedBuffers[i];
if (buffer.notification > 0) { if (buffer.notification > 0) {
$scope.setActiveBuffer(buffer.id); $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 // No notifications, find first buffer with unread lines instead
@ -895,7 +895,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
buffer = sortedBuffers[i]; buffer = sortedBuffers[i];
if (buffer.unread > 0) { if (buffer.unread > 0) {
$scope.setActiveBuffer(buffer.id); $scope.setActiveBuffer(buffer.id);
break; return;
} }
} }
}; };