[tor-commits] [tor-browser] 02/03: Bug 1770137 - Part 2, r=Gijs

gitolite role git at cupani.torproject.org
Mon May 23 08:25:26 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0b3-11.5-2
in repository tor-browser.

commit 0c25bf48cee7ae16d2e3c9f1e4ce60513ed29724
Author: Nika Layzell <nika at thelayzells.com>
AuthorDate: Thu May 19 21:51:15 2022 +0000

    Bug 1770137 - Part 2, r=Gijs
    
    Differential Revision: https://phabricator.services.mozilla.com/D146851
---
 dom/notification/old/NotificationDB.jsm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dom/notification/old/NotificationDB.jsm b/dom/notification/old/NotificationDB.jsm
index eb27b6782ff7a..4d52c96c1aa9c 100644
--- a/dom/notification/old/NotificationDB.jsm
+++ b/dom/notification/old/NotificationDB.jsm
@@ -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.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list