From 580678d26df545cadaa120ff5310a50546f138a0 Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Mon, 12 Apr 2021 12:58:30 +0200 Subject: [PATCH 1/2] so many hours for this --- packages/common-themes/src/Hooks/useDoubleClick.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/common-themes/src/Hooks/useDoubleClick.ts b/packages/common-themes/src/Hooks/useDoubleClick.ts index be465eaf9e..569117896e 100644 --- a/packages/common-themes/src/Hooks/useDoubleClick.ts +++ b/packages/common-themes/src/Hooks/useDoubleClick.ts @@ -16,6 +16,7 @@ export function useDoubleClick(actionSingleClick: () => void, actionDoubleClick: // the duration between this click and the previous one // is less than the value of delay = double-click if (clickCount === 2) { + setClickCount(0) actionDoubleClick && actionDoubleClick() } From 74b4031ac457234e2fcfdec76699cfc02f544176 Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Mon, 12 Apr 2021 12:59:42 +0200 Subject: [PATCH 2/2] lint --- .../Modules/FileBrowsers/views/FileSystemItemRow.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/files-ui/src/Components/Modules/FileBrowsers/views/FileSystemItemRow.tsx b/packages/files-ui/src/Components/Modules/FileBrowsers/views/FileSystemItemRow.tsx index 6621362b07..df7e1f4f42 100644 --- a/packages/files-ui/src/Components/Modules/FileBrowsers/views/FileSystemItemRow.tsx +++ b/packages/files-ui/src/Components/Modules/FileBrowsers/views/FileSystemItemRow.tsx @@ -382,12 +382,12 @@ const FileSystemItemRow: React.FC = ({ } const onSingleClick = useCallback(() => { handleSelect(cid) }, - [cid, content_type, handleSelect, isFolder, name, size]) + [cid, handleSelect]) const onDoubleClick = useCallback(() => { isFolder ? updateCurrentPath(`${currentPath}${name}`, undefined, true) : setPreviewFileIndex(files?.indexOf(file)) - }, [content_type, currentPath, file, files, isFolder, name, setPreviewFileIndex, size, updateCurrentPath]) + }, [currentPath, file, files, isFolder, name, setPreviewFileIndex, updateCurrentPath]) const { click } = useDoubleClick(onSingleClick, onDoubleClick)