make sure images tab is active if auto-switch to new images is on

This commit is contained in:
Mary Hipp 2023-07-07 14:38:57 -04:00 committed by psychedelicious
parent 1cd09a5a53
commit 6399055f7f

View File

@ -38,7 +38,7 @@ type AdditionaGalleryState = {
selection: string[];
shouldAutoSwitch: boolean;
galleryImageMinimumWidth: number;
galleryView: 'images' | 'assets' | 'boards';
galleryView: 'images' | 'assets';
};
export const initialGalleryState =
@ -65,6 +65,8 @@ export const gallerySlice = createSlice({
action.payload.image_category === 'general'
) {
state.selection = [action.payload.image_name];
state.galleryView = 'images';
state.categories = IMAGE_CATEGORIES;
}
},
imageUpdatedOne: (state, action: PayloadAction<Update<ImageDTO>>) => {
@ -128,10 +130,7 @@ export const gallerySlice = createSlice({
setGalleryImageMinimumWidth: (state, action: PayloadAction<number>) => {
state.galleryImageMinimumWidth = action.payload;
},
setGalleryView: (
state,
action: PayloadAction<'images' | 'assets' | 'boards'>
) => {
setGalleryView: (state, action: PayloadAction<'images' | 'assets'>) => {
state.galleryView = action.payload;
},
boardIdSelected: (state, action: PayloadAction<string | undefined>) => {