[tbb-commits] [tor-browser] 02/85: Bug 1770137 - Part 2, r=Gijs, a=dsmith

gitolite role git at cupani.torproject.org
Fri Jun 10 17:00:53 UTC 2022


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

pierov pushed a commit to branch tor-browser-91.9.0esr-11.5-2
in repository tor-browser.

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

    Bug 1770137 - Part 2, r=Gijs, a=dsmith
    
    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 tbb-commits mailing list