handle case where user has no images

This commit is contained in:
Mary Hipp 2023-07-07 15:57:22 -04:00 committed by psychedelicious
parent 84645495a9
commit cbecf3cb89

View File

@ -158,7 +158,7 @@ export const gallerySlice = createSlice({
imagesAdapter.upsertMany(state, transformedItems);
if (state.selection.length === 0) {
if (state.selection.length === 0 && items.length) {
state.selection = [items[0].image_name];
}