Skip to content

Commit 2b217a0

Browse files
committed
fix(stable32): replace getSidebar() with OCA.Files.Sidebar in openInLibreSignAction
getSidebar() is a @nextcloud/files v4-only API, not available in v3.12.x. Replace sidebar open/setActiveTab calls in exec() and execBatch() with the NC32-compatible OCA.Files.Sidebar global, passing node.path instead of the node object (as expected by NC32's sidebar.open(path) signature). Signed-off-by: Vitor Mattos <[email protected]>
1 parent 39ca260 commit 2b217a0

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/actions/openInLibreSignAction.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
5-
import { registerFileAction, getSidebar } from '@nextcloud/files'
5+
import { registerFileAction } from '@nextcloud/files'
66
import { getCapabilities } from '@nextcloud/capabilities'
77
import { loadState } from '@nextcloud/initial-state'
88
import { t } from '@nextcloud/l10n'
@@ -61,11 +61,9 @@ export const action = {
6161
* Single file or folder: open in sidebar
6262
*/
6363
async exec({ nodes }) {
64-
const sidebar = getSidebar()
6564
const node = nodes[0]
66-
await sidebar.open(node, 'libresign')
67-
sidebar.setActiveTab('libresign')
68-
return null
65+
await window.OCA.Files.Sidebar.open(node.path)
66+
window.OCA.Files.Sidebar.setActiveTab('libresign')
6967
},
7068

7169
/**
@@ -101,10 +99,9 @@ export const action = {
10199
uuid: null,
102100
}
103101

104-
const sidebar = getSidebar()
105102
const firstNode = nodes[0]
106-
await sidebar.open(firstNode, 'libresign')
107-
sidebar.setActiveTab('libresign')
103+
await window.OCA.Files.Sidebar.open(firstNode.path)
104+
window.OCA.Files.Sidebar.setActiveTab('libresign')
108105

109106
return new Array(nodes.length).fill(null)
110107
},

0 commit comments

Comments
 (0)