diff --git a/frontend/my/src/Campaign.js b/frontend/my/src/Campaign.js index 12bc0ad..90c3022 100644 --- a/frontend/my/src/Campaign.js +++ b/frontend/my/src/Campaign.js @@ -321,7 +321,7 @@ class TheFormDef extends React.PureComponent { {getFieldDecorator("template_id", { - initialValue: record.template_id ? record.template_id : (this.props.data[cs.ModelTemplates].length === 1 ? this.props.data[cs.ModelTemplates][0].id : undefined), + initialValue: record.template_id ? record.template_id : (this.props.data[cs.ModelTemplates].length > 0 ? this.props.data[cs.ModelTemplates].filter(t => t.is_default)[0].id : undefined), rules: [{ required: true }] })(