Fixes send to buttons

This commit is contained in:
psychedelicious 2022-11-17 20:26:27 +11:00 committed by blessedcoolant
parent ed70fc683c
commit 74485411a8
2 changed files with 13 additions and 4 deletions

View File

@ -107,6 +107,7 @@ const CurrentImageButtons = () => {
shouldShowImageDetails,
currentImage,
isLightBoxOpen,
activeTabName,
} = useAppSelector(systemSelector);
const toast = useToast();
@ -320,10 +321,14 @@ const CurrentImageButtons = () => {
if (!currentImage) return;
if (isLightBoxOpen) dispatch(setIsLightBoxOpen(false));
dispatch(setInitialCanvasImage(currentImage));
dispatch(setShouldLockToInitialImage(true));
dispatch(setInitialCanvasImage(currentImage));
dispatch(setDoesCanvasNeedScaling(true));
if (activeTabName !== 'unifiedCanvas') {
dispatch(setActiveTab('unifiedCanvas'));
}
toast({
title: 'Sent to Unified Canvas',
status: 'success',
@ -336,10 +341,14 @@ const CurrentImageButtons = () => {
if (!currentImage) return;
if (isLightBoxOpen) dispatch(setIsLightBoxOpen(false));
dispatch(setInitialCanvasImage(currentImage));
dispatch(setShouldLockToInitialImage(false));
dispatch(setInitialCanvasImage(currentImage));
dispatch(setDoesCanvasNeedScaling(true));
if (activeTabName !== 'unifiedCanvas') {
dispatch(setActiveTab('unifiedCanvas'));
}
toast({
title: 'Sent to Unified Canvas',
status: 'success',

View File

@ -99,8 +99,8 @@ const HoverableImage = memo((props: HoverableImageProps) => {
const handleSendToInpainting = () => {
if (isLightBoxOpen) dispatch(setIsLightBoxOpen(false));
dispatch(setInitialCanvasImage(image));
dispatch(setShouldLockToInitialImage(true));
dispatch(setInitialCanvasImage(image));
dispatch(setDoesCanvasNeedScaling(true));
if (activeTabName !== 'unifiedCanvas') {
@ -118,8 +118,8 @@ const HoverableImage = memo((props: HoverableImageProps) => {
const handleSendToOutpainting = () => {
if (isLightBoxOpen) dispatch(setIsLightBoxOpen(false));
dispatch(setShouldLockToInitialImage(false));
dispatch(setInitialCanvasImage(image));
dispatch(setShouldLockToInitialImage(true));
dispatch(setDoesCanvasNeedScaling(true));
if (activeTabName !== 'unifiedCanvas') {