@capillarytech/creatives-library 7.17.76 → 7.17.78-alpha.0

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": "7.17.76",
4
+ "version": "7.17.78-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -41,17 +41,17 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
41
41
 
42
42
  const data = device === "android" ? androidContent : iosContent;
43
43
  const content = {
44
- header: data.title,
45
- bodyText: data.message,
46
- bodyImage: data.expandableDetails && data.expandableDetails.image,
44
+ header: data?.title,
45
+ bodyText: data?.message,
46
+ bodyImage: data?.expandableDetails && data?.expandableDetails?.image,
47
47
  actions: [],
48
- appName: templateData.appName,
48
+ appName: templateData?.appName,
49
49
  };
50
- if (data.expandableDetails && data.expandableDetails.ctas && data.expandableDetails.ctas.length) {
50
+ if (data?.expandableDetails && data?.expandableDetails?.ctas && data?.expandableDetails?.ctas?.length) {
51
51
  if (device === "android" ) {
52
- content.actions = map(data.expandableDetails.ctas, (cta) => ({label: cta.actionText}));
52
+ content.actions = map(data?.expandableDetails?.ctas, (cta) => ({label: cta?.actionText}));
53
53
  } else {
54
- content.actions = [{label: data.expandableDetails.ctas[0].actionLabel}, {label: data.expandableDetails.ctas[0].actionLabel2}];
54
+ content.actions = [{label: data?.expandableDetails?.ctas[0]?.actionLabel}, {label: data?.expandableDetails?.ctas[0]?.actionLabel2}];
55
55
  }
56
56
  }
57
57
  return content;
@@ -649,7 +649,7 @@ const Viber = (props) => {
649
649
 
650
650
  const isDisableDone = () => {
651
651
  // textbox area should not empty and should have max 1000 charactor
652
- if (messageContent.trim() === '' || errorMessageTextarea) {
652
+ if (messageContent?.trim() === '' || errorMessageTextarea) {
653
653
  return true;
654
654
  }
655
655
  // cannot send text + image only messages, Need to add button details or remove one of the components in order to proceed
@@ -667,7 +667,7 @@ const Viber = (props) => {
667
667
  return true;
668
668
  }
669
669
  //if template title is empty
670
- if (messageTitle.trim() === '') {
670
+ if (messageTitle?.trim() === '') {
671
671
  return true;
672
672
  }
673
673
  return false;