Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix file upload issue

Stanimir13386a722cae
diff --git a/app/components/TargetFileBox.tsx b/app/components/TargetFileBox.tsx
index b7ca83e1c..c6cab900c 100644
--- a/app/components/TargetFileBox.tsx
+++ b/app/components/TargetFileBox.tsx
@@ -97,26 +97,29 @@ function TargetFileBox(props: Props) {
return Promise.reject(new Error('on files'));
};
- const [collectedProps, drop] = useDrop<DragItem, unknown, DragProps>(() => ({
- accept: props.accepts,
- drop: ({ files }) => {
- if (files && files.length) {
- if (
- AppConfig.isElectron &&
- !PlatformIO.haveObjectStoreSupport() &&
- !PlatformIO.haveWebDavSupport()
- ) {
- return setMoveCopyDialogOpened(files);
- } else {
- return handleCopyFiles(files);
+ const [collectedProps, drop] = useDrop<DragItem, unknown, DragProps>(
+ () => ({
+ accept: props.accepts,
+ drop: ({ files }) => {
+ if (files && files.length) {
+ if (
+ AppConfig.isElectron &&
+ !PlatformIO.haveObjectStoreSupport() &&
+ !PlatformIO.haveWebDavSupport()
+ ) {
+ return setMoveCopyDialogOpened(files);
+ } else {
+ return handleCopyFiles(files);
+ }
}
- }
- },
- collect: (m: DropTargetMonitor) => ({
- handlerId: m.getHandlerId(),
- isActive: m.isOver({ shallow: true }) && m.canDrop()
- })
- }));
+ },
+ collect: (m: DropTargetMonitor) => ({
+ handlerId: m.getHandlerId(),
+ isActive: m.isOver({ shallow: true }) && m.canDrop()
+ })
+ }),
+ [directoryPath]
+ );
drop(ref);