Skip to content

Commit 402b00f

Browse files
susnuxbackportbot[bot]
authored andcommitted
fix(files): make sure drag-and-drop and the upload menu behaves the same
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 54a60f8 commit 402b00f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

apps/files/src/services/DropService.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ export const onDropExternalFiles = async (root: RootDirectory, destination: Fold
9595
// Check for conflicts on root elements
9696
if (await hasConflict(root.contents, contents)) {
9797
root.contents = await resolveConflict(root.contents, destination, contents)
98-
}
99-
100-
if (root.contents.length === 0) {
98+
if (root.contents.length === 0) {
99+
// user cancelled the upload
100+
return []
101+
}
102+
} else if (root.contents.length === 0) {
101103
logger.info('No files to upload', { root })
102104
showInfo(t('files', 'No files to upload'))
103105
return []

apps/files/src/services/DropServiceUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ export const resolveConflict = async <T extends ((Directory|File)|Node)>(files:
170170
} catch (error) {
171171
console.error(error)
172172
// User cancelled
173-
showError(t('files', 'Upload cancelled'))
174-
logger.error('User cancelled the upload')
173+
logger.warn('User cancelled the upload', { error })
174+
showWarning(t('files', 'Upload cancelled'))
175175
}
176176

177177
return []

0 commit comments

Comments
 (0)