Skip to content

Commit 5f68300

Browse files
committed
Make the check case-insensitive
1 parent f2d0271 commit 5f68300

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/actions/mediaLibrary.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function persistMedia(file, opts = {}) {
7979
const backend = currentBackend(state.config);
8080
const integration = selectIntegration(state, null, 'assetStore');
8181
const files = state.mediaLibrary.get('files');
82-
const existingFile = files.find(existingFile => existingFile.name === file.name);
82+
const existingFile = files.find(existingFile => existingFile.name.toLowerCase() === file.name.toLowerCase());
8383

8484
/**
8585
* Check for existing files of the same name before persisting. If no asset
@@ -88,7 +88,7 @@ export function persistMedia(file, opts = {}) {
8888
* may not be unique, so we forego this check.
8989
*/
9090
if (!integration && existingFile) {
91-
if (!window.confirm(`${file.name} already exists. Do you want to replace it?`)) {
91+
if (!window.confirm(`${existingFile.name} already exists. Do you want to replace it?`)) {
9292
return;
9393
} else {
9494
await dispatch(deleteMedia(existingFile, { privateUpload }));

0 commit comments

Comments
 (0)