Skip to content

Commit

Permalink
fixup! Use some instead of every for the permission check
Browse files Browse the repository at this point in the history
Signed-off-by: greta <[email protected]>
  • Loading branch information
GretaD committed Nov 6, 2023
1 parent 8b9f8c5 commit 0b4015b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/files-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ if (nextcloudVersionIsGreaterThanOr28) {
displayName: () => t('contacts', 'Import'),
default: DefaultType.DEFAULT,
enabled: (nodes) => {
return nodes.some((node) => node.mime !== mime || (node.permissions & Permission.READ) === 0)
if (nodes.length !== 1) {
return false
}
const node = nodes[0]
return node.mime === mime && (node.permissions & Permission.UPDATE) !== 0
},
iconSvgInline: () => ContactSvg,
async exec(file) {
Expand Down

0 comments on commit 0b4015b

Please sign in to comment.