@capillarytech/creatives-library 7.9.4 → 7.9.5

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.9.4",
4
+ "version": "7.9.5",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -240,8 +240,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
240
240
  name: this.state.searchText,
241
241
  sortBy: this.state.sortBy,
242
242
  };
243
- if (!isEmpty(this.props.TemplatesList) && !this.props.Templates.getAllTemplatesInProgress && this.props.TemplatesList[0] && this.props.TemplatesList[0].totalCount && this.state.templatesCount === 0) {
244
- this.setState({templatesCount: this.props.TemplatesList[0].totalCount});
243
+ const { totalCount: nextPropsTotalTemplatesCount } = nextProps?.TemplatesList?.[0] || {};
244
+ const { totalCount: propsTotalTemplatesCount } = this.props?.TemplatesList?.[0] || {};
245
+ const { templatesCount } = this.state || {};
246
+
247
+ if (nextPropsTotalTemplatesCount && nextPropsTotalTemplatesCount !== propsTotalTemplatesCount && templatesCount === 0) {
248
+ this.setState({ templatesCount: nextPropsTotalTemplatesCount });
245
249
  }
246
250
  if (!isEqual(nextProps.route.name, this.props.route.name)) {
247
251
  let channel = '';