mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix(files): Show error message if drag-and-drop upload fails
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
e30ce44dac
commit
c91cdb2631
2 changed files with 9 additions and 4 deletions
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import type { Upload } from '@nextcloud/upload'
|
||||
import { showSuccess } from '@nextcloud/dialogs'
|
||||
import { showError, showSuccess } from '@nextcloud/dialogs'
|
||||
import { translate as t } from '@nextcloud/l10n'
|
||||
import { getUploader } from '@nextcloud/upload'
|
||||
import { defineComponent } from 'vue'
|
||||
|
|
@ -105,8 +105,13 @@ export default defineComponent({
|
|||
|
||||
// Start upload
|
||||
logger.debug(`Uploading files to ${this.currentFolder.path}`)
|
||||
const promises = [...event.dataTransfer.files].map((file: File) => {
|
||||
return uploader.upload(file.name, file) as Promise<Upload>
|
||||
const promises = [...event.dataTransfer.files].map(async (file: File) => {
|
||||
try {
|
||||
return await uploader.upload(file.name, file)
|
||||
} catch (e) {
|
||||
showError(t('files', 'Uploading "{filename}" failed', { filename: file.name }))
|
||||
throw e
|
||||
}
|
||||
})
|
||||
|
||||
// Process finished uploads
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ export default Vue.extend({
|
|||
|
||||
// Define current directory children
|
||||
// TODO: make it more official
|
||||
Vue.set(folder, '_children', contents.map(node => node.fileid))
|
||||
this.$set(folder, '_children', contents.map(node => node.fileid))
|
||||
|
||||
// If we're in the root dir, define the root
|
||||
if (dir === '/') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue