Skip to content

Commit

Permalink
Merge pull request #43359 from nextcloud/backport/43318/stable28
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv committed Feb 5, 2024
2 parents 7b7df96 + 34a5394 commit 35934f3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
9 changes: 7 additions & 2 deletions apps/files/src/services/Files.ts
Expand Up @@ -40,9 +40,14 @@ interface ResponseProps extends DAVResultResponseProps {
}

export const resultToNode = function(node: FileStat): File | Folder {
const userId = getCurrentUser()?.uid
if (!userId) {
throw new Error('No user id found')
}

const props = node.props as ResponseProps
const permissions = davParsePermissions(props?.permissions)
const owner = (props['owner-id'] || getCurrentUser()?.uid) as string
const owner = (props['owner-id'] || userId).toString()

const source = generateRemoteUrl('dav' + rootPath + node.filename)
const id = props?.fileid < 0
Expand All @@ -53,7 +58,7 @@ export const resultToNode = function(node: FileStat): File | Folder {
id,
source,
mtime: new Date(node.lastmod),
mime: node.mime as string,
mime: node.mime || 'application/octet-stream',
size: props?.size as number || 0,
permissions,
owner,
Expand Down
4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/systemtags-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/systemtags-init.js.map

Large diffs are not rendered by default.

0 comments on commit 35934f3

Please sign in to comment.