feat(ui): alt-click comparison image exits compare

This commit is contained in:
psychedelicious 2024-06-01 09:48:08 +10:00
parent 1c9c982b63
commit ad9740d72d

View File

@ -38,7 +38,11 @@ export const gallerySlice = createSlice({
state.selection = uniqBy(action.payload, (i) => i.image_name);
},
imageToCompareChanged: (state, action: PayloadAction<ImageDTO | null>) => {
state.imageToCompare = action.payload;
if (state.imageToCompare?.image_name === action.payload?.image_name) {
state.imageToCompare = null;
} else {
state.imageToCompare = action.payload;
}
if (action.payload) {
state.isImageViewerOpen = true;
}