diff --git a/invokeai/frontend/web/src/app/hooks/useStudioInitAction.ts b/invokeai/frontend/web/src/app/hooks/useStudioInitAction.ts index 1f8f7ddac6..a48311e5f2 100644 --- a/invokeai/frontend/web/src/app/hooks/useStudioInitAction.ts +++ b/invokeai/frontend/web/src/app/hooks/useStudioInitAction.ts @@ -12,7 +12,7 @@ import { parseAndRecallAllMetadata } from 'features/metadata/util/handlers'; import { $isWorkflowListMenuIsOpen } from 'features/nodes/store/workflowListMenu'; import { $isStylePresetsMenuOpen, activeStylePresetIdChanged } from 'features/stylePresets/store/stylePresetSlice'; import { toast } from 'features/toast/toast'; -import { setActiveTab } from 'features/ui/store/uiSlice'; +import { activeTabCanvasRightPanelChanged, setActiveTab } from 'features/ui/store/uiSlice'; import { useGetAndLoadLibraryWorkflow } from 'features/workflowLibrary/hooks/useGetAndLoadLibraryWorkflow'; import { useCallback, useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; @@ -140,6 +140,7 @@ export const useStudioInitAction = (action?: StudioInitAction) => { case 'generation': // Go to the canvas tab, open the image viewer, and enable send-to-gallery mode store.dispatch(setActiveTab('canvas')); + store.dispatch(activeTabCanvasRightPanelChanged('gallery')); store.dispatch(settingsSendToCanvasChanged(false)); $imageViewer.set(true); break; diff --git a/invokeai/frontend/web/src/features/controlLayers/components/CanvasAlerts/CanvasAlertsSendingTo.tsx b/invokeai/frontend/web/src/features/controlLayers/components/CanvasAlerts/CanvasAlertsSendingTo.tsx index 67df7ee3a1..16791ee7e6 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/CanvasAlerts/CanvasAlertsSendingTo.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/CanvasAlerts/CanvasAlertsSendingTo.tsx @@ -2,14 +2,10 @@ import { Alert, AlertDescription, AlertIcon, AlertTitle, Button, Flex } from '@i import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { useBoolean } from 'common/hooks/useBoolean'; import { selectIsStaging } from 'features/controlLayers/store/canvasStagingAreaSlice'; -import { - selectCanvasRightPanelGalleryTab, - selectCanvasRightPanelLayersTab, -} from 'features/controlLayers/store/ephemeral'; import { useImageViewer } from 'features/gallery/components/ImageViewer/useImageViewer'; import { useCurrentDestination } from 'features/queue/hooks/useCurrentDestination'; import { selectActiveTab } from 'features/ui/store/uiSelectors'; -import { setActiveTab } from 'features/ui/store/uiSlice'; +import { activeTabCanvasRightPanelChanged, setActiveTab } from 'features/ui/store/uiSlice'; import { AnimatePresence, motion } from 'framer-motion'; import type { PropsWithChildren, ReactNode } from 'react'; import { useCallback, useMemo } from 'react'; @@ -17,10 +13,11 @@ import { Trans, useTranslation } from 'react-i18next'; const ActivateImageViewerButton = (props: PropsWithChildren) => { const imageViewer = useImageViewer(); + const dispatch = useAppDispatch(); const onClick = useCallback(() => { imageViewer.open(); - selectCanvasRightPanelGalleryTab(); - }, [imageViewer]); + dispatch(activeTabCanvasRightPanelChanged('gallery')); + }, [imageViewer, dispatch]); return (