Skip to content

Commit

Permalink
Add copy action for folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Otto-AA committed Mar 4, 2019
1 parent 648a1bb commit fc5b450
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Api/ApiHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,9 @@ export const getActionsByFile = (file, acts = []) => {
typeof file.extractable !== 'undefined' ?
file.extractable && acts.push('extract') :
config.isExtractableFilePattern.test(file.name) && acts.push('extract');

acts.push('copy');
}

acts.push('copy');
acts.push('move');
acts.push('rename');
acts.push('perms');
Expand All @@ -265,14 +264,14 @@ export const getActionsByFile = (file, acts = []) => {
}

/**
* Calculate available actions for selected files, excluding non coincidences
* Calculate available actions for selected files, only leaving common actions
* @param {Array<Object>} files
* @returns {Array<String>}
*/
export const getActionsByMultipleFiles = (files, acts = []) => {
files.forEach(file => {
const fileActs = getActionsByFile(file);
// intersects previous actions with the following to leave only coincidences
// intersects previous actions with the following to leave only common actions
acts = acts.length ? acts.filter(value => -1 !== fileActs.indexOf(value)) : fileActs;
});

Expand Down

0 comments on commit fc5b450

Please sign in to comment.