refactor: separate selectAndUploadFile and uploadFile functions (#2085)

This commit is contained in:
Aman Harwara
2022-12-04 11:11:37 +05:30
committed by GitHub
parent 2175c9cdcb
commit 90e10c76f7
9 changed files with 108 additions and 113 deletions

View File

@@ -51,10 +51,8 @@ const FileViewWithoutProtection = ({ application, viewControllerManager, file }:
if (target) {
addDragTarget(target, {
tooltipText: 'Drop your files to upload and link them to the current file',
callback(files) {
files.forEach(async (uploadedFile) => {
await viewControllerManager.linkingController.linkItems(uploadedFile, file)
})
async callback(uploadedFile) {
await viewControllerManager.linkingController.linkItems(uploadedFile, file)
},
})
}