@bindu-dashing/dam-solution-v2 5.8.53 → 5.8.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -100,7 +100,6 @@ function DriveContainer({ parentFolderId, setSelectedFile, setParentFolderId, pi
|
|
|
100
100
|
}
|
|
101
101
|
}, []);
|
|
102
102
|
const folders = useMemo(() => {
|
|
103
|
-
console.log('## foldersPaginatedData', foldersPaginatedData);
|
|
104
103
|
return !!foldersPaginatedData
|
|
105
104
|
? flatMap(get(foldersPaginatedData, "pages"), "folders")
|
|
106
105
|
: [];
|
|
@@ -48,6 +48,7 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
48
48
|
const { showPreviewModal, selectedFile } = state;
|
|
49
49
|
const { type } = useAppParams();
|
|
50
50
|
const clickTimer = useRef(null);
|
|
51
|
+
const lastClickedId = useRef(null);
|
|
51
52
|
const assetIds = Array.from(new Set(folders
|
|
52
53
|
.filter((f) => get(f, "type") === EntityType.FILE)
|
|
53
54
|
.map((f) => get(f, "assetId"))
|
|
@@ -63,6 +64,7 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
63
64
|
const handleClick = (folder) => {
|
|
64
65
|
const id = get(folder, "_id");
|
|
65
66
|
const fileType = get(folder, "type", EntityType.FOLDER);
|
|
67
|
+
console.log('## handleClick', folder, id, fileType);
|
|
66
68
|
if (isImagePicker) {
|
|
67
69
|
if (fileType === EntityType.FILE) {
|
|
68
70
|
setSelectedFile === null || setSelectedFile === void 0 ? void 0 : setSelectedFile(folder);
|
|
@@ -77,18 +79,34 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
else {
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
+
// Check if this is a double click (same item clicked within timer window)
|
|
83
|
+
const isDoubleClick = clickTimer.current !== null && lastClickedId.current === id;
|
|
84
|
+
if (isDoubleClick) {
|
|
85
|
+
// Double click detected - clear timer and handle double click action
|
|
86
|
+
if (clickTimer.current) {
|
|
87
|
+
clearTimeout(clickTimer.current);
|
|
88
|
+
}
|
|
82
89
|
clickTimer.current = null;
|
|
90
|
+
lastClickedId.current = null;
|
|
91
|
+
console.log('## isDoubleClick', isDoubleClick, id, fileType, navigate);
|
|
83
92
|
if (fileType === EntityType.FOLDER && navigate) {
|
|
93
|
+
// Double click on folder: navigate into folder
|
|
84
94
|
navigate(SUBFOLDERS_SCREEN.replace(":folderId", id));
|
|
85
95
|
}
|
|
86
|
-
if (fileType === EntityType.FILE && type !== DriveModes.TRASH) {
|
|
96
|
+
else if (fileType === EntityType.FILE && type !== DriveModes.TRASH) {
|
|
97
|
+
// Double click on file: show preview
|
|
87
98
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { selectedFile: folder, showPreviewModal: true })));
|
|
88
99
|
}
|
|
89
100
|
return;
|
|
90
101
|
}
|
|
102
|
+
// Single click - set timer for selection
|
|
103
|
+
if (clickTimer.current) {
|
|
104
|
+
// Different item clicked, clear previous timer
|
|
105
|
+
clearTimeout(clickTimer.current);
|
|
106
|
+
}
|
|
107
|
+
lastClickedId.current = id;
|
|
91
108
|
clickTimer.current = setTimeout(() => {
|
|
109
|
+
// Single click action: toggle selection
|
|
92
110
|
if (fileType === EntityType.FILE) {
|
|
93
111
|
const alreadySelected = includes(selectedFileIds, id);
|
|
94
112
|
setSelectedItems({
|
|
@@ -106,6 +124,7 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
106
124
|
});
|
|
107
125
|
}
|
|
108
126
|
clickTimer.current = null;
|
|
127
|
+
lastClickedId.current = null;
|
|
109
128
|
}, 250);
|
|
110
129
|
}
|
|
111
130
|
};
|