Revert commit 7eec859 ("Do not remove stuff from lists")

When removing a download, Angular doesn't update the download list correctly
when it receives new data unless we pull out the item that should be removed
from the array manually first.
This commit is contained in:
Puzzles Flat 2014-10-25 02:27:09 +13:00
parent 3811093c3a
commit a4fb25802d

11
js/ctrls/main.js Normal file → Executable file
View File

@ -95,6 +95,17 @@ function(
d.followedFrom = null; d.followedFrom = null;
} }
rpc.once(method, [d.gid], cb); rpc.once(method, [d.gid], cb);
var lists = [scope.active, scope.waiting, scope.stopped], ind = -1, i;
for (var i = 0; i < lists.length; ++i) {
var list = lists[i];
var idx = list.indexOf(d);
if (idx < 0) {
continue;
}
list.splice(idx, 1);
return;
}
}, 0); }, 0);
} }