@mjhls/mjh-framework 1.0.535 → 1.0.536

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.535
2
+ # mjh-framework v. 1.0.536
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -35,7 +35,7 @@ var visibilitySensor = require('./visibility-sensor-0c45a583.js');
35
35
  require('./index-b5eb3ff8.js');
36
36
  var main = require('./main-bc4db521.js');
37
37
  require('./slicedToArray-8063ee51.js');
38
- require('./stringify-7c5aff47.js');
38
+ var stringify = require('./stringify-7c5aff47.js');
39
39
  var asyncToGenerator = require('./asyncToGenerator-8e707718.js');
40
40
  require('./_set-species-4458e975.js');
41
41
  require('./beam-d22818d3.js');
@@ -120,11 +120,11 @@ var MasterDeck = function (_React$Component) {
120
120
  var pointer = _this.pointer;
121
121
  dataArr = dataArr[_this.pointerArray][pointer];
122
122
  }
123
- dataArr = dataArr.map(function (item) {
123
+ dataArr = Array.isArray(dataArr) ? dataArr.map(function (item) {
124
124
  return _extends._extends({}, item, {
125
125
  pageNumber: page
126
126
  });
127
- });
127
+ }) : [];
128
128
 
129
129
  _this.setState(function () {
130
130
  if (dataArr.length > 0) {
@@ -256,13 +256,6 @@ var MasterDeck = function (_React$Component) {
256
256
  !_this.state.dataRemapped && _this.setState({ dataRemapped: true }); // To detect if appending of insights ads are completed
257
257
  }
258
258
 
259
- // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
260
- _this.componentDidUpdate = function () {
261
- if (typeof window !== 'undefined' && (!lgInfeedAd || !brandInsightAd || window.innerWidth < 1400) && !_this.state.dataRemapped) {
262
- !_this.state.dataRemapped && _this.setState({ dataRemapped: true });
263
- }
264
- };
265
-
266
259
  // Integrating infeed AD
267
260
  if (showBI && brandInsightAd) {
268
261
  // Checking lgInfeedAd flag in desktop view ( window >= 1400px ).
@@ -398,7 +391,7 @@ var MasterDeck = function (_React$Component) {
398
391
  inherits._createClass(MasterDeck, [{
399
392
  key: 'componentDidUpdate',
400
393
  value: function componentDidUpdate(prevProps, prevState) {
401
- if (this.state.dataKeptToCompareNewDatarecord !== this.props.dataRecord) {
394
+ if (this.state.dataKeptToCompareNewDatarecord !== this.props.dataRecord || stringify._JSON$stringify(this.props.dataRecord) !== stringify._JSON$stringify(this.state.data)) {
402
395
  // eslint-disable-next-line react/no-did-update-set-state
403
396
  this.setState({
404
397
  data: this.props.dataRecord,
@@ -412,6 +405,10 @@ var MasterDeck = function (_React$Component) {
412
405
  query: this.props.query
413
406
  });
414
407
  }
408
+ // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
409
+ if (typeof window !== 'undefined' && (!this.props.lgInfeedAd || !this.props.brandInsightAd || window.innerWidth < 1400) && !this.state.dataRemapped) {
410
+ !this.state.dataRemapped && this.setState({ dataRemapped: true });
411
+ }
415
412
  }
416
413
  }, {
417
414
  key: 'componentDidMount',
@@ -29,7 +29,7 @@ import { V as VisibilitySensor } from './visibility-sensor-0baa4eea.js';
29
29
  import './index-51a80699.js';
30
30
  import { m as main_39 } from './main-7255814e.js';
31
31
  import './slicedToArray-f1e40361.js';
32
- import './stringify-e30bc114.js';
32
+ import { _ as _JSON$stringify } from './stringify-e30bc114.js';
33
33
  import { _ as _Promise } from './asyncToGenerator-0379e924.js';
34
34
  import './_set-species-6f64f1c1.js';
35
35
  import './beam-a25bd8fd.js';
@@ -114,11 +114,11 @@ var MasterDeck = function (_React$Component) {
114
114
  var pointer = _this.pointer;
115
115
  dataArr = dataArr[_this.pointerArray][pointer];
116
116
  }
117
- dataArr = dataArr.map(function (item) {
117
+ dataArr = Array.isArray(dataArr) ? dataArr.map(function (item) {
118
118
  return _extends({}, item, {
119
119
  pageNumber: page
120
120
  });
121
- });
121
+ }) : [];
122
122
 
123
123
  _this.setState(function () {
124
124
  if (dataArr.length > 0) {
@@ -250,13 +250,6 @@ var MasterDeck = function (_React$Component) {
250
250
  !_this.state.dataRemapped && _this.setState({ dataRemapped: true }); // To detect if appending of insights ads are completed
251
251
  }
252
252
 
253
- // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
254
- _this.componentDidUpdate = function () {
255
- if (typeof window !== 'undefined' && (!lgInfeedAd || !brandInsightAd || window.innerWidth < 1400) && !_this.state.dataRemapped) {
256
- !_this.state.dataRemapped && _this.setState({ dataRemapped: true });
257
- }
258
- };
259
-
260
253
  // Integrating infeed AD
261
254
  if (showBI && brandInsightAd) {
262
255
  // Checking lgInfeedAd flag in desktop view ( window >= 1400px ).
@@ -392,7 +385,7 @@ var MasterDeck = function (_React$Component) {
392
385
  _createClass(MasterDeck, [{
393
386
  key: 'componentDidUpdate',
394
387
  value: function componentDidUpdate(prevProps, prevState) {
395
- if (this.state.dataKeptToCompareNewDatarecord !== this.props.dataRecord) {
388
+ if (this.state.dataKeptToCompareNewDatarecord !== this.props.dataRecord || _JSON$stringify(this.props.dataRecord) !== _JSON$stringify(this.state.data)) {
396
389
  // eslint-disable-next-line react/no-did-update-set-state
397
390
  this.setState({
398
391
  data: this.props.dataRecord,
@@ -406,6 +399,10 @@ var MasterDeck = function (_React$Component) {
406
399
  query: this.props.query
407
400
  });
408
401
  }
402
+ // set dataRemap to true as there are no infeed or BI ads or window width is less than limit
403
+ if (typeof window !== 'undefined' && (!this.props.lgInfeedAd || !this.props.brandInsightAd || window.innerWidth < 1400) && !this.state.dataRemapped) {
404
+ !this.state.dataRemapped && this.setState({ dataRemapped: true });
405
+ }
409
406
  }
410
407
  }, {
411
408
  key: 'componentDidMount',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.535",
3
+ "version": "1.0.536",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",