fix(files): recursive drop path join

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ 2023-12-19 09:46:56 +01:00
parent 66b2fd95d1
commit 820b67a5e2
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF

View file

@ -29,6 +29,7 @@ import { davGetClient, davGetDefaultPropfind, davResultToNode, davRootPath } fro
import { translate as t } from '@nextcloud/l10n'
import { getUploader } from '@nextcloud/upload'
import logger from '../logger.js'
import { joinPaths } from '@nextcloud/paths'
export const handleDrop = async (data: DataTransfer) => {
// TODO: Maybe handle `getAsFileSystemHandle()` in the future
@ -85,10 +86,12 @@ const handleRecursiveUpload = async (entry: FileSystemEntry, path: string = ''):
]
} else {
const directory = entry as FileSystemDirectoryEntry
logger.debug('Handle directory recursivly', { name: directory.name })
// TODO: Implement this on `@nextcloud/upload`
const absolutPath = `${davRootPath}${getUploader().destination.path}${path}${directory.name}`
const absolutPath = joinPaths(davRootPath, getUploader().destination.path, path, directory.name)
logger.debug('Handle directory recursively', { name: directory.name, absolutPath })
const davClient = davGetClient()
const dirExists = await davClient.exists(absolutPath)
if (!dirExists) {