mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): only clear comparison image on alt click of gallery image
This logic can't e in the reducer else it applies to dnd events which isn't right
This commit is contained in:
parent
ad9740d72d
commit
d0fca53e67
@ -43,7 +43,11 @@ export const addGalleryImageClickedListener = (startAppListening: AppStartListen
|
||||
const selection = state.gallery.selection;
|
||||
|
||||
if (altKey) {
|
||||
if (state.gallery.imageToCompare?.image_name === imageDTO.image_name) {
|
||||
dispatch(imageToCompareChanged(null));
|
||||
} else {
|
||||
dispatch(imageToCompareChanged(imageDTO));
|
||||
}
|
||||
} else if (shiftKey) {
|
||||
const rangeEndImageName = imageDTO.image_name;
|
||||
const lastSelectedImage = selection[selection.length - 1]?.image_name;
|
||||
|
@ -38,11 +38,7 @@ export const gallerySlice = createSlice({
|
||||
state.selection = uniqBy(action.payload, (i) => i.image_name);
|
||||
},
|
||||
imageToCompareChanged: (state, action: PayloadAction<ImageDTO | null>) => {
|
||||
if (state.imageToCompare?.image_name === action.payload?.image_name) {
|
||||
state.imageToCompare = null;
|
||||
} else {
|
||||
state.imageToCompare = action.payload;
|
||||
}
|
||||
if (action.payload) {
|
||||
state.isImageViewerOpen = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user