From 83eb5113302b439587250d17903e382b527a21bf Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Mon, 10 Jul 2023 18:44:54 -0400 Subject: [PATCH] disable hotkey for lightbox if lightbox is disabled --- .../frontend/web/src/features/ui/components/InvokeTabs.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx b/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx index 9eb99afa3e..ef168285ee 100644 --- a/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx +++ b/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx @@ -38,6 +38,7 @@ import NodesTab from './tabs/Nodes/NodesTab'; import ResizeHandle from './tabs/ResizeHandle'; import TextToImageTab from './tabs/TextToImage/TextToImageTab'; import UnifiedCanvasTab from './tabs/UnifiedCanvas/UnifiedCanvasTab'; +import { useFeatureStatus } from '../../system/hooks/useFeatureStatus'; export interface InvokeTabInfo { id: InvokeTabName; @@ -107,6 +108,7 @@ const InvokeTabs = () => { const isLightBoxOpen = useAppSelector( (state: RootState) => state.lightbox.isLightboxOpen ); + const isLightboxEnabled = useFeatureStatus('lightbox').isFeatureEnabled; const { shouldPinGallery, shouldPinParametersPanel, shouldShowGallery } = useAppSelector((state: RootState) => state.ui); @@ -119,7 +121,9 @@ const InvokeTabs = () => { useHotkeys( 'z', () => { - dispatch(setIsLightboxOpen(!isLightBoxOpen)); + if (isLightboxEnabled) { + dispatch(setIsLightboxOpen(!isLightBoxOpen)); + } }, [isLightBoxOpen] );