mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1770137 - Part 2, r=Gijs, a=dsmith
Differential Revision: https://phabricator.services.mozilla.com/D146851
This commit is contained in:
parent
e7bf90ac75
commit
78d17b06b0
@ -75,13 +75,14 @@ var NotificationDB = {
|
||||
},
|
||||
|
||||
filterNonAppNotifications(notifications) {
|
||||
let result = Object.create(null);
|
||||
for (let origin in notifications) {
|
||||
result[origin] = Object.create(null);
|
||||
let persistentNotificationCount = 0;
|
||||
for (let id in notifications[origin]) {
|
||||
if (notifications[origin][id].serviceWorkerRegistrationScope) {
|
||||
persistentNotificationCount++;
|
||||
} else {
|
||||
delete notifications[origin][id];
|
||||
result[origin][id] = notifications[origin][id];
|
||||
}
|
||||
}
|
||||
if (persistentNotificationCount == 0) {
|
||||
@ -90,11 +91,11 @@ var NotificationDB = {
|
||||
"Origin " + origin + " is not linked to an app manifest, deleting."
|
||||
);
|
||||
}
|
||||
delete notifications[origin];
|
||||
delete result[origin];
|
||||
}
|
||||
}
|
||||
|
||||
return notifications;
|
||||
return result;
|
||||
},
|
||||
|
||||
// Attempt to read notification file, if it's not there we will create it.
|
||||
|
Loading…
Reference in New Issue
Block a user