From 7cf2329467bb7e8a7eb8dea27d193a2e3b0d8ee3 Mon Sep 17 00:00:00 2001 From: greta Date: Wed, 25 Oct 2023 13:50:20 +0200 Subject: [PATCH] fixup! Import file FileAction 28 compatibility Signed-off-by: greta --- src/files-action.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/files-action.js b/src/files-action.js index b1e4142ed..229ca9d43 100644 --- a/src/files-action.js +++ b/src/files-action.js @@ -24,10 +24,10 @@ import { translate as t } from '@nextcloud/l10n' import { registerFileAction, FileAction } from '@nextcloud/files' const mime = 'text/vcard' const name = 'contacts-import' -const nextcloudIsGreaterThan26 = parseInt(OC.config.version.split('.')[0]) >= 26 +const nextcloudVersionIs28 = parseInt(OC.config.version.split('.')[0]) === 28 window.addEventListener('DOMContentLoaded', () => { - if (!nextcloudIsGreaterThan26 && OCA.Files && OCA?.Files?.fileActions) { + if (!nextcloudVersionIs28 && OCA.Files && OCA.Files.fileActions) { OCA.Files.fileActions.registerAction({ name, displayName: t('contacts', 'Import'), @@ -45,7 +45,7 @@ window.addEventListener('DOMContentLoaded', () => { console.error('Unable to register vcf import action') }) -if (nextcloudIsGreaterThan26) { +if (nextcloudVersionIs28) { registerFileAction(new FileAction({ name, displayName() {