Skip to content

Commit a382c05

Browse files
author
Vikas Agarwal
committed
fix: git#1097-The Continue Setup Button disable: Unable to create the challenge, task, and first2finish due to this
1 parent 0db5ad9 commit a382c05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/ChallengeEditor/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,9 +1144,10 @@ class ChallengeEditor extends Component {
11441144

11451145
// all timeline template ids available for the challenge type
11461146
const availableTemplateIds = _.filter(challengeTimelines, ct => ct.typeId === challenge.typeId && ct.trackId === challenge.trackId).map(tt => tt.timelineTemplateId)
1147-
const defaultChallengeTimeline = _.find(challengeTimelines, ct => ct.isDefault)
1147+
const defaultChallengeTimeline = _.find(challengeTimelines, ct => ct.typeId === challenge.typeId && ct.trackId === challenge.trackId && ct.isDefault)
11481148
// filter and return timeline templates that are available for this challenge type
1149-
return _.map(_.filter(timelineTemplates, tt => availableTemplateIds.indexOf(tt.id) !== -1), tt => tt.id === defaultChallengeTimeline.timelineTemplateId ? { ...tt, isDefault: true } : tt)
1149+
const avlTemplates = _.filter(timelineTemplates, tt => availableTemplateIds.indexOf(tt.id) !== -1)
1150+
return _.map(avlTemplates, tt => tt.id === defaultChallengeTimeline.timelineTemplateId ? { ...tt, isDefault: true } : tt)
11501151
}
11511152

11521153
render () {

0 commit comments

Comments
 (0)