Skip to content

Commit

Permalink
fix: adding multiple images via media library
Browse files Browse the repository at this point in the history
  • Loading branch information
demshy committed Aug 23, 2023
1 parent 1850f4c commit b1a6a63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/decap-cms-core/src/reducers/mediaLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const defaultState: {
config: Map<string, unknown>;
field?: EntryField;
value?: string | string[];
replaceIndex?: number;
replaceIndex?: number | boolean;
} = {
isVisible: false,
showMediaButton: true,
Expand Down Expand Up @@ -91,8 +91,8 @@ function mediaLibrary(state = Map(defaultState), action: MediaLibraryAction) {
map.set('privateUpload', privateUpload);
map.set('config', libConfig);
map.set('field', field ?? '');
map.set('value', value ?? '');
map.set('replaceIndex', replaceIndex ?? 0);
map.set('value', value == '' && libConfig.get('multiple') ? [] : (value ?? ''));
map.set('replaceIndex', replaceIndex ?? false);
});
}

Expand Down

0 comments on commit b1a6a63

Please sign in to comment.