@capillarytech/creatives-library 9.0.15 → 9.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "9.0.15",
4
+ "version": "9.0.16",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -194,7 +194,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
194
194
  // const formData = _.cloneDeep(this.state.formData);
195
195
  if (this.props.params.id || (this.props.location.query.module === "library" && this.props.templateData && !_.isEmpty(this.props.templateData))) {
196
196
  this.setState({isEdit: true}, () => {
197
- if (this.props.params.id) {
197
+ // Embedded campaign content is authoritative via the inline templateData
198
+ // prop; fetching by id would pull reusable-template data and drop the
199
+ // inline BEE json_content. Only fetch for real reusable-template edits.
200
+ if (this.props.params.id && this.props.location.query.type !== 'embedded') {
198
201
  this.props.actions.getTemplateDetails(this.props.params.id, 'email');
199
202
  }
200
203
  });
@@ -470,7 +473,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
470
473
  }
471
474
  });
472
475
  }
473
- if (this.state.isEdit && nextProps.location.query.module === "library" && !_.isEmpty(nextProps.templateData) && !this.props.params.id && !nextProps.isGetFormData && _.isEmpty(_.get(this, `state.formData['template-subject']`))) {
476
+ if (this.state.isEdit && nextProps.location.query.module === "library" && !_.isEmpty(nextProps.templateData) && (!this.props.params.id || nextProps.location.query.type === "embedded") && !nextProps.isGetFormData && _.isEmpty(_.get(this, `state.formData['template-subject']`))) {
474
477
  this.startTemplateCreation(nextProps.templateData);
475
478
  }
476
479
  if (nextProps.location.query.module === 'library' && nextProps.isGetFormData && (this.props.isGetFormData !== nextProps.isGetFormData)) {