From 12ed3a3ea3f9efe45a9ad00aae2642610d3cd1c9 Mon Sep 17 00:00:00 2001 From: Roland <49903851+rolandinus@users.noreply.github.com> Date: Thu, 5 Dec 2019 15:14:23 +0100 Subject: [PATCH] return early if no files are selected return early from _onSelectTag, _onSelectTag if no tags are selected. Signed-off-by: Roland Scheidel --- apps/files/js/filelist.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index e9bccbfd30687..307f7fe408e84 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1146,10 +1146,9 @@ * @private */ _onSelectTag: function(tagModel) { - console.log('selected',tagModel.attributes); var selectedFiles = _.pluck(this.getSelectedFiles(),'id') if (!_.isArray(selectedFiles)) { - console.log('selected files - no array!', selectedFiles); + return; } selectedFiles.forEach(function(fileId) { $.ajax({ @@ -1165,10 +1164,9 @@ * @private */ _onDeselectTag: function(tagId) { - var selectedFiles = _.pluck(this.getSelectedFiles(),'id') - console.log('removing tag', tagId, 'for files', selectedFiles, this.getSelectedFiles()) + var selectedFiles = _.pluck(this.getSelectedFiles(),'id'); if (!_.isArray(selectedFiles)) { - console.log('selected files - no array!', selectedFiles); + return; } selectedFiles.forEach(function(fileId) { console.log('remove tag route',OC.linkToRemote('dav') + '/systemtags-relations/files/' +fileId + '/'+ tagId)