mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix dnd on nodes
I had broken this earlier today
This commit is contained in:
parent
6c6d600cea
commit
2a7dee17be
@ -80,15 +80,14 @@ const ControlNetImagePreview = (props: Props) => {
|
||||
}
|
||||
}, [controlImage, controlNetId]);
|
||||
|
||||
const droppableData = useMemo<TypesafeDroppableData | undefined>(() => {
|
||||
if (controlNetId) {
|
||||
return {
|
||||
id: controlNetId,
|
||||
actionType: 'SET_CONTROLNET_IMAGE',
|
||||
context: { controlNetId },
|
||||
};
|
||||
}
|
||||
}, [controlNetId]);
|
||||
const droppableData = useMemo<TypesafeDroppableData | undefined>(
|
||||
() => ({
|
||||
id: controlNetId,
|
||||
actionType: 'SET_CONTROLNET_IMAGE',
|
||||
context: { controlNetId },
|
||||
}),
|
||||
[controlNetId]
|
||||
);
|
||||
|
||||
const postUploadAction = useMemo<PostUploadAction>(
|
||||
() => ({ type: 'SET_CONTROLNET_IMAGE', controlNetId }),
|
||||
|
@ -16,7 +16,6 @@ import {
|
||||
import IAIDndImage from 'common/components/IAIDndImage';
|
||||
import { useGetImageDTOQuery } from 'services/api/endpoints/images';
|
||||
import { PostUploadAction } from 'services/api/thunks/image';
|
||||
import { ImageDTO } from 'services/api/types';
|
||||
import { FieldComponentProps } from './types';
|
||||
|
||||
const ImageInputFieldComponent = (
|
||||
@ -33,23 +32,6 @@ const ImageInputFieldComponent = (
|
||||
isSuccess,
|
||||
} = useGetImageDTOQuery(field.value?.image_name ?? skipToken);
|
||||
|
||||
const handleDrop = useCallback(
|
||||
({ image_name }: ImageDTO) => {
|
||||
if (field.value?.image_name === image_name) {
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(
|
||||
fieldValueChanged({
|
||||
nodeId,
|
||||
fieldName: field.name,
|
||||
value: { image_name },
|
||||
})
|
||||
);
|
||||
},
|
||||
[dispatch, field.name, field.value, nodeId]
|
||||
);
|
||||
|
||||
const handleReset = useCallback(() => {
|
||||
dispatch(
|
||||
fieldValueChanged({
|
||||
@ -70,15 +52,14 @@ const ImageInputFieldComponent = (
|
||||
}
|
||||
}, [field.name, imageDTO, nodeId]);
|
||||
|
||||
const droppableData = useMemo<TypesafeDroppableData | undefined>(() => {
|
||||
if (imageDTO) {
|
||||
return {
|
||||
id: `node-${nodeId}-${field.name}`,
|
||||
actionType: 'SET_NODES_IMAGE',
|
||||
context: { nodeId, fieldName: field.name },
|
||||
};
|
||||
}
|
||||
}, [field.name, imageDTO, nodeId]);
|
||||
const droppableData = useMemo<TypesafeDroppableData | undefined>(
|
||||
() => ({
|
||||
id: `node-${nodeId}-${field.name}`,
|
||||
actionType: 'SET_NODES_IMAGE',
|
||||
context: { nodeId, fieldName: field.name },
|
||||
}),
|
||||
[field.name, nodeId]
|
||||
);
|
||||
|
||||
const postUploadAction = useMemo<PostUploadAction>(
|
||||
() => ({
|
||||
|
Loading…
Reference in New Issue
Block a user