From 6d9b21eeeeffa48417a5993478e89b060e1e4fa8 Mon Sep 17 00:00:00 2001 From: maxceem Date: Tue, 29 Sep 2020 12:50:13 +0300 Subject: [PATCH] fix: avoid duplicate final deliverable ref issue #781 #782 --- src/components/ChallengeEditor/FinalDeliverables-Field/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ChallengeEditor/FinalDeliverables-Field/index.js b/src/components/ChallengeEditor/FinalDeliverables-Field/index.js index 57ead390..fbec690e 100644 --- a/src/components/ChallengeEditor/FinalDeliverables-Field/index.js +++ b/src/components/ChallengeEditor/FinalDeliverables-Field/index.js @@ -34,7 +34,7 @@ class FinalDeliverablesField extends Component { const { challenge, readOnly, removeFileType } = this.props const fileTypesMetadata = _.find(challenge.metadata, { name: 'fileTypes' }) const fileTypes = (fileTypesMetadata && JSON.parse(fileTypesMetadata.value)) || [] - const isDuplicateValue = _.includes(fileTypes, this.state.newFileType.trim()) + const isDuplicateValue = _.includes(fileTypes.map((fileType) => fileType.toLowerCase()), this.state.newFileType.toLowerCase().trim()) return (