Skip to content

Commit 35ec297

Browse files
committed
fix(FilePicker): Modernise dav imports
Signed-off-by: Louis Chmn <louis@chmn.me>
1 parent db434b6 commit 35ec297

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

apps/files/src/actions/moveOrCopyAction.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import CopyIconSvg from '@mdi/svg/svg/folder-multiple-outline.svg?raw'
1313
import { isAxiosError } from '@nextcloud/axios'
1414
import { FilePickerClosed, getFilePickerBuilder, showError, showInfo, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'
1515
import { emit } from '@nextcloud/event-bus'
16-
import { davGetClient, davGetDefaultPropfind, davResultToNode, davRootPath, FileAction, FileType, getUniqueName, NodeStatus, Permission } from '@nextcloud/files'
16+
import { FileAction, FileType, getUniqueName, NodeStatus, Permission } from '@nextcloud/files'
17+
import { defaultRootPath, getClient, getDefaultPropfind, resultToNode } from '@nextcloud/files/dav'
1718
import { translate as t } from '@nextcloud/l10n'
1819
import { hasConflict, openConflictPicker } from '@nextcloud/upload'
1920
import { basename, join } from 'path'
@@ -119,9 +120,9 @@ export async function handleCopyMoveNodeTo(node: Node, destination: Folder, meth
119120
}
120121

121122
try {
122-
const client = davGetClient()
123-
const currentPath = join(davRootPath, node.path)
124-
const destinationPath = join(davRootPath, destination.path)
123+
const client = getClient()
124+
const currentPath = join(defaultRootPath, node.path)
125+
const destinationPath = join(defaultRootPath, destination.path)
125126

126127
if (method === MoveCopyAction.COPY) {
127128
let target = node.basename
@@ -144,10 +145,10 @@ export async function handleCopyMoveNodeTo(node: Node, destination: Folder, meth
144145
join(destinationPath, target),
145146
{
146147
details: true,
147-
data: davGetDefaultPropfind(),
148+
data: getDefaultPropfind(),
148149
},
149150
) as ResponseDataDetailed<FileStat>
150-
emit('files:node:created', davResultToNode(data))
151+
emit('files:node:created', resultToNode(data))
151152
}
152153
} else {
153154
// show conflict file popup if we do not allow overwriting

0 commit comments

Comments
 (0)