Bug 1617268 - fix error in code for moving feeds to subfolder of another account. r=benc DONTBUILD
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Sun, 23 Feb 2020 12:57:42 +0200
changeset 37413 1f033493764ccc27c4a31c00a1ca07310f62f4d1
parent 37412 7a6241d7c2f6fa6a9c7b414222cb2b8f6f6bd2ab
child 37414 7953b475f1c1265ea4e456fe093f36cd83c8c6b3
push id2566
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:20:31 +0000
treeherdercomm-beta@a352facfa0a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbenc
bugs1617268
Bug 1617268 - fix error in code for moving feeds to subfolder of another account. r=benc DONTBUILD
mailnews/extensions/newsblog/content/FeedUtils.jsm
--- a/mailnews/extensions/newsblog/content/FeedUtils.jsm
+++ b/mailnews/extensions/newsblog/content/FeedUtils.jsm
@@ -1147,30 +1147,30 @@ var FeedUtils = {
       // Moving to trash. Unsubscribe.
       affectedSubs.forEach(function(sub) {
         let feed = new Feed(sub.url, aFolder);
         FeedUtils.deleteFeed(feed);
       });
       // note: deleteFeed() calls saveSoon(), so we don't need to.
     } else if (aFolder.server == aOrigFolder.server) {
       // Staying in same account - just update destFolder as required
-      affectedSubs.forEach(function(sub) {
+      for (let sub of affectedSubs) {
         sub.destFolder = folderURI;
-      });
+      };
       origDS.saveSoon();
     } else {
-      // Moving between folders.
+      // Moving between accounts.
       let destDS = this.getSubscriptionsDS(aFolder.server);
-      affectedSubs.forEach(function(sub) {
+      for (let sub of affectedSubs) {
         // Move to the new subscription db (replacing any existing entry).
         origDS.data = origDS.data.filter(x => x.url != sub.url);
         destDS.data = destDS.data.filter(x => x.url != sub.url);
         sub.destFolder = folderURI;
-        destDS.push(sub);
-      });
+        destDS.data.push(sub);
+      };
       this.setFolderPaneProperty(aFolder, "favicon", null, "row");
       origDS.saveSoon();
       destDS.saveSoon();
     }
   },
 
   /**
    * When subscribing to feeds by dnd on, or adding a url to, the account