From c2f67c119fb6c3191a9b04e64d4b22680c239c3d Mon Sep 17 00:00:00 2001 From: Eric Doughty-Papassideris Date: Thu, 26 Sep 2024 16:25:26 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20front:=20remove=20arrow=20keys?= =?UTF-8?q?=20from=20preview=20if=20a=20single=20file=20available=20(#661)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/views/client/viewer/drive-preview.tsx | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tdrive/frontend/src/app/views/client/viewer/drive-preview.tsx b/tdrive/frontend/src/app/views/client/viewer/drive-preview.tsx index fb4e2ef3..06904f5b 100644 --- a/tdrive/frontend/src/app/views/client/viewer/drive-preview.tsx +++ b/tdrive/frontend/src/app/views/client/viewer/drive-preview.tsx @@ -63,6 +63,8 @@ export const DrivePreview: React.FC = ({ items }) => { }, []); useEffect(() => { + if (items.length < 2) + return () => {}; addShortcut({ shortcut: 'Right', handler: handleSwitchRight }); addShortcut({ shortcut: 'Left', handler: handleSwitchLeft }); @@ -146,22 +148,26 @@ export const DrivePreview: React.FC = ({ items }) => {
-