From 8af101985078a02070e5637bc74e229c56ddc687 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Tue, 3 Oct 2023 19:35:45 +0300 Subject: [PATCH] [ENG-872, ENG-1177] - Windows enter key opens & Open context menu correction (#1424) * Enter key opens on windows, cmd and o on mac. Open in context menu now opens in SD and not Finder. * Remove access time func as doubleClick already does it --- .../Explorer/ContextMenu/FilePath/Items.tsx | 31 ++--------- .../app/$libraryId/Explorer/View/index.tsx | 51 +++++-------------- .../settings/client/keybindings.tsx | 2 +- 3 files changed, 20 insertions(+), 64 deletions(-) diff --git a/interface/app/$libraryId/Explorer/ContextMenu/FilePath/Items.tsx b/interface/app/$libraryId/Explorer/ContextMenu/FilePath/Items.tsx index 361b36e67..926777b08 100644 --- a/interface/app/$libraryId/Explorer/ContextMenu/FilePath/Items.tsx +++ b/interface/app/$libraryId/Explorer/ContextMenu/FilePath/Items.tsx @@ -1,5 +1,5 @@ import { Image, Package, Trash, TrashSimple } from '@phosphor-icons/react'; -import { libraryClient, useLibraryContext, useLibraryMutation } from '@sd/client'; +import { libraryClient, useLibraryMutation } from '@sd/client'; import { ContextMenu, dialogManager, ModifierKeys, toast } from '@sd/ui'; import { Menu } from '~/components/Menu'; import { useKeybindFactory } from '~/hooks/useKeybindFactory'; @@ -10,6 +10,7 @@ import { useExplorerContext } from '../../Context'; import { CopyAsPathBase } from '../../CopyAsPath'; import DeleteDialog from '../../FilePath/DeleteDialog'; import EraseDialog from '../../FilePath/EraseDialog'; +import { useViewItemDoubleClick } from '../../View/ViewItem'; import { Conditional, ConditionalItem } from '../ConditionalItem'; import { useContextMenuContext } from '../context'; import OpenWith from './OpenWith'; @@ -237,12 +238,10 @@ export const OpenOrDownload = new ConditionalItem({ return { openFilePaths, selectedFilePaths }; }, - Component: ({ openFilePaths, selectedFilePaths }) => { + Component: () => { const keybind = useKeybindFactory(); const { platform } = usePlatform(); - const updateAccessTime = useLibraryMutation('files.updateAccessTime'); - - const { library } = useLibraryContext(); + const { doubleClick } = useViewItemDoubleClick(); if (platform === 'web') return