@posiwise/dashboard-module 0.0.51 → 0.0.53

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.
@@ -392,17 +392,19 @@ class NavbarComponent extends AppBaseComponent {
392
392
  // TODO: Add animation while removing
393
393
  const index = this.notifications.findIndex(x => x.id === id);
394
394
  this.notifications.splice(index, 1);
395
- const val = JSON.parse(data);
396
- if (val.length > 0) {
397
- val.forEach(element => {
398
- const existNotification = this.notifications.find(({ key }) => element.id === key);
399
- if (!existNotification) {
400
- this.notifications.push(element);
401
- if (element.unread === true) {
402
- this.notificationCount++;
395
+ if (data) {
396
+ const val = JSON.parse(data);
397
+ if (val.length > 0) {
398
+ val.forEach(element => {
399
+ const existNotification = this.notifications.find(({ key }) => element.id === key);
400
+ if (!existNotification) {
401
+ this.notifications.push(element);
402
+ if (element.unread === true) {
403
+ this.notificationCount++;
404
+ }
403
405
  }
404
- }
405
- });
406
+ });
407
+ }
406
408
  }
407
409
  if (this.notifications.length === 0) {
408
410
  this.noNoti = true;