Skip to content

Commit 006e2c4

Browse files
authored
Merge pull request #4040 from QuantiModo/feature/length
notifications.length
2 parents 9ca2950 + 1c5648f commit 006e2c4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/js/qmHelpers.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5500,7 +5500,7 @@ var qm = {
55005500
getAllUniqueNotifications: function(){
55015501
qm.qmLog.info("Called getAllUniqueRatingNotifications");
55025502
var notifications = qm.storage.getItem(qm.items.trackingReminderNotifications);
5503-
if(!notifications){
5503+
if(!notifications || !notifications.length){
55045504
qm.qmLog.info("No notifications in storage!");
55055505
return null;
55065506
}
@@ -5545,7 +5545,7 @@ var qm = {
55455545
removeNotificationFromSyncQueueAndUnhide: function(){
55465546
qm.qmLog.info("Called undo notification tracking...");
55475547
var notificationsSyncQueue = qm.storage.getItem(qm.items.notificationsSyncQueue);
5548-
if(!notificationsSyncQueue){
5548+
if(!notificationsSyncQueue || !notificationsSyncQueue.length){
55495549
return false;
55505550
}
55515551
notificationsSyncQueue[0].hide = false;
@@ -7439,7 +7439,7 @@ var qm = {
74397439
return userVariable;
74407440
},
74417441
setTrackingReminderNotifications: function(notifications){
7442-
if(!notifications){
7442+
if(!notifications || !notifications.length){
74437443
qm.qmLog.error("No notifications provided to qm.storage.setTrackingReminderNotifications");
74447444
return;
74457445
}
@@ -7712,7 +7712,8 @@ var qm = {
77127712
if(isNaN(trackingReminderNotificationId) && body.trackingReminderNotificationId){
77137713
trackingReminderNotificationId = body.trackingReminderNotificationId;
77147714
}
7715-
if(qm.storage.getTrackingReminderNotifications() && qm.storage.getTrackingReminderNotifications().length){
7715+
var notifications = qm.storage.getTrackingReminderNotifications();
7716+
if(notifications && notifications.length){
77167717
qm.qmLog.info(null, 'Deleting notification with id ' + trackingReminderNotificationId, null);
77177718
qm.storage.deleteById(qm.items.trackingReminderNotifications, trackingReminderNotificationId);
77187719
}else{

0 commit comments

Comments
 (0)