Skip to content

Commit

Permalink
fix: load script on init step
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <[email protected]>

[skip ci]
  • Loading branch information
skjnldsv authored and backportbot[bot] committed Aug 27, 2024
1 parent 2131810 commit 57067d2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/Listeners/LoadAdditionalScriptsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
class LoadAdditionalScriptsListener implements IEventListener {
public function handle(Event $event): void {
\OCP\Util::addInitScript('groupfolders', 'groupfolders-init');
\OCP\Util::addScript('groupfolders', 'groupfolders-files');
\OCP\Util::addScript('groupfolders', 'groupfolders-main');
}
}
8 changes: 4 additions & 4 deletions src/actions/openGroupfolderAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { translate as t } from '@nextcloud/l10n'
import type { Node } from '@nextcloud/files'

import { registerFileAction, FileAction, DefaultType } from '@nextcloud/files'
import { FileAction, DefaultType } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'

registerFileAction(new FileAction({
export const action = new FileAction({
id: 'open-group-folders',
displayName: () => t('files', 'Open group folder'),
iconSvgInline: () => '',
Expand All @@ -27,4 +27,4 @@ registerFileAction(new FileAction({
default: DefaultType.DEFAULT,
// Before openFolderAction
order: -1000,
}))
})
2 changes: 1 addition & 1 deletion src/main.ts β†’ src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { translate as t } from '@nextcloud/l10n'
import { View, getNavigation } from '@nextcloud/files'
import GroupFolderSvg from '../img/app-dark.svg?raw'
import { getContents } from './services/groupfolders'
import './actions/openGroupfolderAction'
import { action as openGroupfolderAction} from './actions/openGroupfolderAction'

const Navigation = getNavigation()
Navigation.register(new View({
Expand Down
18 changes: 10 additions & 8 deletions webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ const path = require('path')
const webpackConfig = require('@nextcloud/webpack-vue-config')
const webpackRules = require('@nextcloud/webpack-vue-config/rules')

webpackConfig.entry.main = path.resolve(path.join('src', 'main.ts'))
webpackConfig.entry.settings = [
'whatwg-fetch',
'./src/settings/index.tsx',
]
webpackConfig.entry.files = [
'./src/files.js',
]
webpackConfig.entry = {
init: path.resolve(path.join('src', 'init.ts')),
files: [
'./src/files.js',
],
settings: [
'whatwg-fetch',
'./src/settings/index.tsx',
],
}

webpackConfig.resolve.extensions = [...webpackConfig.resolve.extensions, '.jsx', '.ts', '.tsx']

Expand Down

0 comments on commit 57067d2

Please sign in to comment.