From a4fb25802df76db5110449ca19113b803312ed5d Mon Sep 17 00:00:00 2001 From: Puzzles Flat Date: Sat, 25 Oct 2014 02:27:09 +1300 Subject: [PATCH] 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. --- js/ctrls/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) mode change 100644 => 100755 js/ctrls/main.js diff --git a/js/ctrls/main.js b/js/ctrls/main.js old mode 100644 new mode 100755 index 5a94c12..7e02178 --- a/js/ctrls/main.js +++ b/js/ctrls/main.js @@ -95,6 +95,17 @@ function( d.followedFrom = null; } 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); }