summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorTomasz Grobelny <tomasz@grobelny.net>2018-11-03 23:01:32 +0000
committerTomasz Grobelny <tomasz@grobelny.net>2018-11-03 23:01:32 +0000
commit41687ef00fa5667467564770a4e29403e32d167f (patch)
tree843983106315bac2a0af955e442fe34f9d2956d0 /apps/files/js
parent68a27debd1e64f2dc21288fc5d43181bb61cd8f1 (diff)
downloadnextcloud-server-41687ef00fa5667467564770a4e29403e32d167f.tar.gz
nextcloud-server-41687ef00fa5667467564770a4e29403e32d167f.zip
Fix move related tests
Signed-off-by: Tomasz Grobelny <tomasz@grobelny.net>
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 31d80bbb246..02dcbf7650f 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -989,7 +989,7 @@
});
}
- this.move(_.pluck(files, 'name'), targetPath);
+ var movePromise = this.move(_.pluck(files, 'name'), targetPath);
// re-enable td elements to be droppable
// sometimes the filename drop handler is still called after re-enable,
@@ -997,6 +997,8 @@
setTimeout(function() {
self.$el.find('td.filename.ui-droppable').droppable('enable');
}, 10);
+
+ return movePromise;
},
/**
@@ -2229,8 +2231,8 @@
var mcSemaphore = new Semaphore(10);
var counter = 0;
- _.each(fileNames, function(arg) {
- mcSemaphore.acquire().then(function(){
+ var promises = _.map(fileNames, function(arg) {
+ return mcSemaphore.acquire().then(function(){
moveFileFunction(arg).then(function(){
mcSemaphore.release();
counter++;
@@ -2238,9 +2240,11 @@
});
});
- if (callback) {
- callback();
- }
+ return Promise.all(promises).then(function(){
+ if (callback) {
+ callback();
+ }
+ });
},
/**