Skip to content

Commit

Permalink
Fix isTemplate check and hidden parameters with changing values
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Feb 11, 2016
1 parent 215433e commit 74fb3a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/components/base/Wizard.js
Expand Up @@ -353,7 +353,7 @@ class Wizard extends React.Component {
});
} else if (input.type === "hidden") {
return (
<input type="hidden" name={name} value={input.value}/>
<input type="hidden" name={name} value={value || input.value}/>
);
} else if (input.type === "boolean") {
formElement = (
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/experiments/ExperimentWizard.js
Expand Up @@ -144,7 +144,7 @@ class ExperimentWizard extends Wizard {
};

if (this.state.loaded && !this.state.failed) {
let isTemplate = this.state.new && this.props.location.state && "template" in this.props.location.state || this.state.data && "templateId" in this.state.data;
let isTemplate = this.state.new && this.props.location.state && "template" in this.props.location.state || this.state.data && "templateId" in this.state.data && this.state.data.templateId;

if (isTemplate) {
let text;
Expand Down Expand Up @@ -446,7 +446,7 @@ class ExperimentWizard extends Wizard {
type: "hidden",
value: "",
encoder: (i) => {
return i ? {value: i} : null;
return i ? {value: parseInt(i)} : null;
},
decoder: (i) => {
return i ? i.value : null;
Expand Down

0 comments on commit 74fb3a1

Please sign in to comment.