|
|
|
@ -90,10 +90,11 @@ export async function dataTransferToFileTree(items: DataTransferItem[]): Promise
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Handle dropping external files
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param root
|
|
|
|
* @param root - The root directory which should be uploaded
|
|
|
|
* @param destination
|
|
|
|
* @param destination - The destination folder
|
|
|
|
* @param contents
|
|
|
|
* @param contents - The contents of the destination folder
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
export async function onDropExternalFiles(root: RootDirectory, destination: Folder, contents: Node[]): Promise<Upload[]> {
|
|
|
|
export async function onDropExternalFiles(root: RootDirectory, destination: Folder, contents: Node[]): Promise<Upload[]> {
|
|
|
|
const uploader = getUploader()
|
|
|
|
const uploader = getUploader()
|
|
|
|
@ -101,9 +102,11 @@ export async function onDropExternalFiles(root: RootDirectory, destination: Fold
|
|
|
|
// Check for conflicts on root elements
|
|
|
|
// Check for conflicts on root elements
|
|
|
|
if (await hasConflict(root.contents, contents)) {
|
|
|
|
if (await hasConflict(root.contents, contents)) {
|
|
|
|
root.contents = await resolveConflict(root.contents, destination, contents)
|
|
|
|
root.contents = await resolveConflict(root.contents, destination, contents)
|
|
|
|
}
|
|
|
|
if (root.contents.length === 0) {
|
|
|
|
|
|
|
|
// user cancelled the upload
|
|
|
|
if (root.contents.length === 0) {
|
|
|
|
return []
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (root.contents.length === 0) {
|
|
|
|
logger.info('No files to upload', { root })
|
|
|
|
logger.info('No files to upload', { root })
|
|
|
|
showInfo(t('files', 'No files to upload'))
|
|
|
|
showInfo(t('files', 'No files to upload'))
|
|
|
|
return []
|
|
|
|
return []
|
|
|
|
|