From edf040e3d2ae8135c0023be798f71e82c2e7813c Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:17:51 +1000 Subject: [PATCH] feat(ui): hide bbox button when no canvas session active --- .../controlLayers/components/ToolChooser.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/controlLayers/components/ToolChooser.tsx b/invokeai/frontend/web/src/features/controlLayers/components/ToolChooser.tsx index e1bfe85a1f..706d51b74c 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/ToolChooser.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/ToolChooser.tsx @@ -1,4 +1,5 @@ import { ButtonGroup } from '@invoke-ai/ui-library'; +import { useAppSelector } from 'app/store/storeHooks'; import { BboxToolButton } from 'features/controlLayers/components/BboxToolButton'; import { BrushToolButton } from 'features/controlLayers/components/BrushToolButton'; import { EraserToolButton } from 'features/controlLayers/components/EraserToolButton'; @@ -11,6 +12,20 @@ import { useCanvasResetLayerHotkey } from 'features/controlLayers/hooks/useCanva export const ToolChooser: React.FC = () => { useCanvasResetLayerHotkey(); useCanvasDeleteLayerHotkey(); + const isCanvasSessionActive = useAppSelector((s) => s.canvasV2.session.isActive); + + if (isCanvasSessionActive) { + return ( + + + + + + + + + ); + } return ( @@ -19,7 +34,6 @@ export const ToolChooser: React.FC = () => { - ); };