Fix the async iterator

This commit is contained in:
Johannes Zellner
2016-06-08 13:35:32 +02:00
parent e2432d002f
commit 526a62a20e

View File

@@ -168,6 +168,8 @@ angular.module('Application').controller('AccountController', ['$scope', 'Client
function asyncForEach(items, handler, callback) {
var cur = 0;
if (items.length === 0) return callback();
(function iterator() {
handler(items[cur], function () {
if (cur >= items.length-1) return callback();