diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-09-05 13:40:29 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-09-05 13:40:29 +0200 |
commit | fb9fe6da2b2fb3f06b7e7a36b6f6c1f0d6cc6db4 (patch) | |
tree | 0391f56d33829cb6c95906574bd6e53c7954123b | |
parent | b0e1808b1be4873fa58e310c84b82d99794d7812 (diff) |
Fix files-actions script name
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r-- | src/files-action.js (renamed from src/files_action.js) | 11 | ||||
-rw-r--r-- | webpack.js | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/files_action.js b/src/files-action.js index 436fb59f..08365744 100644 --- a/src/files_action.js +++ b/src/files-action.js @@ -21,12 +21,15 @@ */ import { generateUrl } from '@nextcloud/router' +const mime = 'text/vcard' +const name = 'contacts-import' + window.addEventListener('DOMContentLoaded', () => { if (OCA.Files && OCA.Files.fileActions) { OCA.Files.fileActions.registerAction({ - name: 'contacts_import', + name, displayName: t('contacts', 'Import'), - mime: 'text/vcard', + mime, permissions: OC.PERMISSION_READ, iconClass: 'icon-contacts', actionHandler(fileName, context) { @@ -34,6 +37,8 @@ window.addEventListener('DOMContentLoaded', () => { window.location = generateUrl(`/apps/contacts/import?file=${absPath}`) }, }) - OCA.Files.fileActions.setDefault('text/vcard', 'contacts_import') + OCA.Files.fileActions.setDefault(mime, name) + return } + console.error('Unable to register vcf import action') }) @@ -2,7 +2,7 @@ const path = require('path') const webpack = require('webpack') const webpackConfig = require('@nextcloud/webpack-vue-config') -webpackConfig.entry['files-action'] = path.join(__dirname, 'src', 'files_action.js') +webpackConfig.entry['files-action'] = path.join(__dirname, 'src', 'files-action.js') webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)) module.exports = webpackConfig |