Skip to content

Commit

Permalink
outcome value for credits is now 0 in the config - MR
Browse files Browse the repository at this point in the history
  • Loading branch information
marungo committed Mar 20, 2018
1 parent 014181a commit d8cb402
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions app/components/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ export default class Branch extends React.Component {
}

getOtherLevelIndices() {
return Array(this.props.numLevels).fill()
.map((_, i) => i + 1)
.filter(index => index !== this.props.parentIndex);
}

processOutcomeListText(outcomeNumber) {
return "Level " + outcomeNumber;
console.log(this.props.parentIndex);
return Array(this.props.numLevels+1).fill()
.map((_, i) => i === 0 ? "Credits" : "Level " + i)
.filter((_,index) => index !== Number(this.props.parentIndex));
}

branch() {
Expand All @@ -46,8 +43,7 @@ export default class Branch extends React.Component {
onChange={this.handleTimeRangeChange} numFrames={this.props.numFrames}/>
 Outcome: 
<select name="outcome" id="outcome" value={branch.outcome} onChange={this.handleBranchInputChange}>
<option value="0" selected="selected">Credits</option>
{ otherLevelIndices.map((i) => <option value={i}> {this.processOutcomeListText(i)}</option>) }
{ otherLevelIndices.map((outcome,i) => <option value={i}>{outcome}</option>) }
</select>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion app/utilities/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const createDefaultBranch = () => {
start: defaultValues.time,
end: defaultValues.time,
enabled: defaultValues.enabled,
outcome: "Credits"
outcome: "0"
};
}

Expand Down

0 comments on commit d8cb402

Please sign in to comment.