diff --git a/lib/Listener/LoadContactsFilesActions.php b/lib/Listener/LoadContactsFilesActions.php index 87f93e753..b9296f881 100644 --- a/lib/Listener/LoadContactsFilesActions.php +++ b/lib/Listener/LoadContactsFilesActions.php @@ -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'); } } } diff --git a/src/files-action.js b/src/files-action.js index 3b62764a4..2db84c8e4 100644 --- a/src/files-action.js +++ b/src/files-action.js @@ -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) {