|
3 | 3 | * SPDX-License-Identifier: AGPL-3.0-or-later |
4 | 4 | */ |
5 | 5 |
|
6 | | -import type { Folder, IFolder, INode } from '@nextcloud/files' |
| 6 | +import type { Folder, IFolder, INode, Node } from '@nextcloud/files' |
7 | 7 | import type { Upload } from '@nextcloud/upload' |
8 | 8 | import type { RootDirectory } from './DropServiceUtils.ts' |
9 | 9 |
|
10 | | -import { createDirectoryIfNotExists, Directory, resolveConflict, traverseTree } from './DropServiceUtils.ts' |
11 | 10 | import { showError, showInfo, showSuccess, showWarning } from '@nextcloud/dialogs' |
12 | 11 | import { t } from '@nextcloud/l10n' |
13 | 12 | import { join } from '@nextcloud/paths' |
14 | 13 | import { getUploader, hasConflict } from '@nextcloud/upload' |
15 | | -import { handleCopyMoveNodesTo, HintException } from '../actions/moveOrCopyAction.ts' |
16 | | -import { MoveCopyAction } from '../actions/moveOrCopyActionUtils.ts' |
| 14 | +import { Directory, traverseTree, resolveConflict, createDirectoryIfNotExists } from './DropServiceUtils' |
| 15 | +import { MoveCopyAction } from '../actions/moveOrCopyActionUtils' |
17 | 16 | import logger from '../logger.ts' |
18 | | -import { defaultRootPath } from '@nextcloud/files/dav' |
| 17 | +import { handleCopyMoveNodesTo, HintException } from '../actions/moveOrCopyAction.ts' |
19 | 18 |
|
20 | 19 | /** |
21 | 20 | * This function converts a list of DataTransferItems to a file tree. |
@@ -123,14 +122,13 @@ export async function onDropExternalFiles(root: RootDirectory, destination: Fold |
123 | 122 | // If the file is a directory, we need to create it first |
124 | 123 | // then browse its tree and upload its contents. |
125 | 124 | if (file instanceof Directory) { |
126 | | - const absolutePath = join(defaultRootPath, destination.path, relativePath) |
127 | 125 | try { |
128 | | - console.debug('Processing directory', { relativePath }) |
129 | | - await createDirectoryIfNotExists(absolutePath) |
| 126 | + logger.debug('Processing directory', { relativePath }) |
| 127 | + await createDirectoryIfNotExists(relativePath) |
130 | 128 | await uploadDirectoryContents(file, relativePath) |
131 | 129 | } catch (error) { |
132 | 130 | showError(t('files', 'Unable to create the directory {directory}', { directory: file.name })) |
133 | | - logger.error('', { error, absolutePath, directory: file }) |
| 131 | + logger.error('Unable to create the directory', { error, relativePath, directory: file }) |
134 | 132 | } |
135 | 133 | continue |
136 | 134 | } |
|
0 commit comments