Skip to content

Commit

Permalink
return early if no files are selected
Browse files Browse the repository at this point in the history
return early from _onSelectTag, _onSelectTag if no tags are selected.

Signed-off-by: Roland Scheidel <[email protected]>
  • Loading branch information
rolandinus committed Dec 9, 2019
1 parent f476ab4 commit 12ed3a3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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)
Expand Down

0 comments on commit 12ed3a3

Please sign in to comment.