Skip to content

Commit 578df9a

Browse files
fix: register file actions and fix DAV stat path in init.ts
The openInLibreSignAction and showStatusInlineAction modules were never imported by any bundle entry point, so registerFileAction() was never called and those actions never appeared in the Files context-menu. The DAV client.stat() call was using a bare path (e.g. /folder/file.pdf) which resolves to /remote.php/dav/folder/file.pdf and returns 404. The path must be prefixed with getRootPath() (/files/{uid}/...) so the request goes to the correct WebDAV endpoint. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 5dd4a30 commit 578df9a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/init.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import axios from '@nextcloud/axios'
77
import { addNewFileMenuEntry, Permission, getSidebar } from '@nextcloud/files'
88
import type { NewMenuEntry, IFolder, INode } from '@nextcloud/files'
99
import { registerDavProperty } from '@nextcloud/files/dav'
10-
import { getClient, resultToNode } from '@nextcloud/files/dav'
10+
import { getClient, getRootPath, resultToNode } from '@nextcloud/files/dav'
1111
import { t } from '@nextcloud/l10n'
1212
import { generateOcsUrl } from '@nextcloud/router'
1313
import { getUploader } from '@nextcloud/upload'
1414
import type { Uploader } from '@nextcloud/upload'
1515
import type { FileStat, ResponseDataDetailed } from 'webdav'
1616

17-
import logger from './logger'
17+
import './actions/openInLibreSignAction.js'
18+
import './actions/showStatusInlineAction.js'
1819
import LibreSignLogoSvg from '../img/app-colored.svg?raw'
1920
import LibreSignLogoDarkSvg from '../img/app-dark.svg?raw'
2021
import { useIsDarkTheme } from './helpers/useIsDarkTheme'
@@ -66,7 +67,7 @@ addNewFileMenuEntry({
6667

6768
// Fetch the complete node object from the Files API
6869
const client = getClient()
69-
const result = await client.stat(path, { details: true }) as ResponseDataDetailed<FileStat>
70+
const result = await client.stat(`${getRootPath()}${path}`, { details: true }) as ResponseDataDetailed<FileStat>
7071
const node = resultToNode(result.data)
7172

7273
// Open sidebar with LibreSign tab

0 commit comments

Comments
 (0)