Skip to content

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

KanBan Improvements v3 (#1952)

Stanimirc404f8407c77
diff --git a/app/components/menus/FileMenu.tsx b/app/components/menus/FileMenu.tsx
index c18882deb..8cce0fd0a 100644
--- a/app/components/menus/FileMenu.tsx
+++ b/app/components/menus/FileMenu.tsx
@@ -101,6 +101,7 @@ interface Props {
setLastBackgroundImageChange: (path: string, dt: number) => void;
reorderTop?: () => void;
reorderBottom?: () => void;
+ onDuplicateFile?: (fileDirPath: string) => void;
exitSearchMode: () => void;
prefixTagContainer: string;
}
@@ -247,11 +248,15 @@ function FileMenu(props: Props) {
PlatformIO.copyFilePromise(selectedFilePath, newFilePath)
.then(() => {
- props.loadDirectoryContent(dirPath, true, true);
+ if (props.onDuplicateFile) {
+ props.onDuplicateFile(dirPath);
+ } else {
+ props.loadDirectoryContent(dirPath, true, true);
+ }
return true;
})
.catch(error => {
- showNotification('Error creating duplicate: ' + error.message);
+ showNotification('Error creating duplicate: ', error);
});
}
}