mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
disable hotkey for lightbox if lightbox is disabled
This commit is contained in:
parent
f46f8058be
commit
83eb511330
@ -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]
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user