fix(ui): when changing viewer state, always clear compare image

This commit is contained in:
psychedelicious 2024-06-01 09:44:19 +10:00
parent 8ea4067f83
commit 3cfd2755c2

View File

@ -89,10 +89,7 @@ export const gallerySlice = createSlice({
state.alwaysShowImageSizeBadge = action.payload; state.alwaysShowImageSizeBadge = action.payload;
}, },
isImageViewerOpenChanged: (state, action: PayloadAction<boolean>) => { isImageViewerOpenChanged: (state, action: PayloadAction<boolean>) => {
if (state.isImageViewerOpen && state.imageToCompare) { state.imageToCompare = null;
state.imageToCompare = null;
return;
}
state.isImageViewerOpen = action.payload; state.isImageViewerOpen = action.payload;
}, },
comparedImagesSwapped: (state) => { comparedImagesSwapped: (state) => {