Skip to content

Commit 39ca260

Browse files
committed
fix(stable32): replace getSidebar() with OCA.Files.Sidebar in init.ts
getSidebar() is a @nextcloud/files v4-only API, not available in v3.12.x. Replace sidebar open calls with the NC32-compatible global: window.OCA.Files?.Sidebar?.open(node.path) window.OCA.Files?.Sidebar?.setActiveTab('libresign') Signed-off-by: Vitor Mattos <[email protected]>
1 parent 311ba91 commit 39ca260

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/init.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import axios from '@nextcloud/axios'
7-
import { addNewFileMenuEntry, Permission, getSidebar } from '@nextcloud/files'
7+
import { addNewFileMenuEntry, Permission } from '@nextcloud/files'
88
import type { NewMenuEntry, IFolder, INode } from '@nextcloud/files'
99
import { registerDavProperty } from '@nextcloud/files/dav'
1010
import { getClient, resultToNode } from '@nextcloud/files/dav'
@@ -70,9 +70,8 @@ addNewFileMenuEntry({
7070
const node = resultToNode(result.data)
7171

7272
// Open sidebar with LibreSign tab
73-
const sidebar = getSidebar()
74-
sidebar.open(node, 'libresign')
75-
sidebar.setActiveTab('libresign')
73+
window.OCA.Files?.Sidebar?.open(node.path)
74+
window.OCA.Files?.Sidebar?.setActiveTab('libresign')
7675
}
7776

7877
input.click()

0 commit comments

Comments
 (0)