fix(ui): allow drop of currently-selected image for compare

This commit is contained in:
psychedelicious 2024-06-01 09:41:54 +10:00
parent dd74e89127
commit 940de6a5c5

View File

@ -33,9 +33,7 @@ export const isValidDrop = (overData?: TypesafeDroppableData | null, activeData?
return ( return (
payloadType === 'IMAGE_DTO' && payloadType === 'IMAGE_DTO' &&
activeData.id !== 'image-compare-first-image' && activeData.id !== 'image-compare-first-image' &&
activeData.id !== 'image-compare-second-image' && activeData.id !== 'image-compare-second-image'
activeData.payload.imageDTO.image_name !== overData.context.firstImageName &&
activeData.payload.imageDTO.image_name !== overData.context.secondImageName
); );
case 'ADD_TO_BOARD': { case 'ADD_TO_BOARD': {
// If the board is the same, don't allow the drop // If the board is the same, don't allow the drop