switch to generation tab when someone sends to img2img

This commit is contained in:
Mary Hipp 2024-05-08 15:31:14 -04:00 committed by Mary Hipp Rogers
parent 6c768bfe7e
commit 5820579237
3 changed files with 4 additions and 0 deletions

View File

@ -73,6 +73,7 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => {
const handleSendToImageToImage = useCallback(() => {
dispatch(sentImageToImg2Img());
dispatch(iiLayerAdded(imageDTO));
dispatch(setActiveTab('generation'));
}, [dispatch, imageDTO]);
const handleSendToCanvas = useCallback(() => {

View File

@ -30,6 +30,7 @@ import {
PiRulerBold,
} from 'react-icons/pi';
import { useGetImageDTOQuery } from 'services/api/endpoints/images';
import { setActiveTab } from '../../../ui/store/uiSlice';
const selectShouldDisableToolbarButtons = createSelector(
selectSystemSlice,
@ -84,6 +85,7 @@ const CurrentImageButtons = () => {
}
dispatch(sentImageToImg2Img());
dispatch(iiLayerAdded(imageDTO));
dispatch(setActiveTab('generation'));
}, [dispatch, imageDTO]);
useHotkeys('shift+i', handleSendToImageToImage, [imageDTO]);

View File

@ -38,6 +38,7 @@ export const usePreselectedImage = (selectedImage?: {
const handleSendToImg2Img = useCallback(() => {
if (selectedImageDto) {
dispatch(iiLayerAdded(selectedImageDto));
dispatch(setActiveTab("generation"))
}
}, [dispatch, selectedImageDto]);