Skip to content

Commit

Permalink
Merge 7cd9992 into 1611f5e
Browse files Browse the repository at this point in the history
  • Loading branch information
GretaD authored Nov 8, 2023
2 parents 1611f5e + 7cd9992 commit af8a5b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Listener/LoadContactsFilesActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function handle(Event $event): void {
if (method_exists(Util::class, 'addInitScript')) {
Util::addInitScript(Application::APP_ID, 'contacts-files-action');
} else {
Util::addScript(Application::APP_ID, 'contacts-files-action');
Util::addScript(Application::APP_ID, 'contacts-files-action', 'files');

Check warning on line 45 in lib/Listener/LoadContactsFilesActions.php

View check run for this annotation

Codecov / codecov/patch

lib/Listener/LoadContactsFilesActions.php#L45

Added line #L45 was not covered by tests
}
}
}
7 changes: 5 additions & 2 deletions src/files-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ if (nextcloudVersionIsGreaterThanOr28) {
id: name,
displayName: () => t('contacts', 'Import'),
default: DefaultType.DEFAULT,
mime,
enabled: (nodes) => {
return nodes.every((node) => node.mime === mime && (node.permissions & Permission.READ))
if (nodes.length !== 1) {
return false
}
const node = nodes[0]
return node.mime === mime && (node.permissions & Permission.READ)
},
iconSvgInline: () => ContactSvg,
async exec(file) {
Expand Down

0 comments on commit af8a5b7

Please sign in to comment.