Skip to content

Commit 48ef27a

Browse files
committed
refactor: use getSidebar() API in inline status action
Update showStatusInlineAction to use @nextcloud/files v4 sidebar API: - Import getSidebar() from @nextcloud/files - Replace window.OCA.Files.Sidebar with getSidebar() proxy - Pass node object directly to sidebar.open() - Use sidebar.setActiveTab() to activate LibreSign tab - Add proper availability checks and error handling Signed-off-by: Vitor Mattos <[email protected]>
1 parent cd1caa2 commit 48ef27a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/actions/showStatusInlineAction.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
5-
import { FileAction, registerFileAction } from '@nextcloud/files'
5+
import { FileAction, registerFileAction, getSidebar } from '@nextcloud/files'
66
import { loadState } from '@nextcloud/initial-state'
77
import { t } from '@nextcloud/l10n'
88

@@ -26,8 +26,8 @@ const action = new FileAction({
2626
},
2727
exec: async ({ nodes }) => {
2828
const node = nodes[0]
29-
await window.OCA.Files.Sidebar.open(node.path)
30-
window.OCA.Files.Sidebar.setActiveTab('libresign')
29+
sidebar.open(node, 'libresign')
30+
sidebar.setActiveTab('libresign')
3131
return null
3232
},
3333
iconSvgInline: ({ nodes }) => {
@@ -48,7 +48,7 @@ const action = new FileAction({
4848
const certificateOk = loadState('libresign', 'certificate_ok')
4949
const allPdf = nodes?.length > 0 && nodes.every(node => node.mime === 'application/pdf')
5050
const allHaveStatus = nodes?.every(node => node.attributes['libresign-signature-status'])
51-
51+
5252
return certificateOk && allPdf && allHaveStatus
5353
},
5454
order: -1,

0 commit comments

Comments
 (0)