Bug 1613535 follow-up - Fix "this.forgetAttachment is not a function" when closing compose window. rs=me DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Sun, 10 May 2020 11:08:05 +1200
changeset 29544 2a5f7a05bc2c89f1a5dfd420af889cd4d64cd21e
parent 29543 954fd5e540b5233ff74c6916cccc5d6e7ed97193
child 29545 9129a21f6faca3ff846b238cd723cb1f5faa8cd7
push id17423
push usergeoff@darktrojan.net
push dateMon, 11 May 2020 09:27:39 +0000
treeherdercomm-central@2a5f7a05bc2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1613535
Bug 1613535 follow-up - Fix "this.forgetAttachment is not a function" when closing compose window. rs=me DONTBUILD
mail/components/extensions/parent/ext-compose.js
--- a/mail/components/extensions/parent/ext-compose.js
+++ b/mail/components/extensions/parent/ext-compose.js
@@ -350,17 +350,19 @@ var composeAttachmentTracker = {
     if (!attachment) {
       return null;
     }
 
     let uri = Services.io.newURI(attachment.url).QueryInterface(Ci.nsIFileURL);
     return File.createFromNsIFile(uri.file);
   },
 };
-windowTracker.addCloseListener(composeAttachmentTracker.forgetAttachments);
+windowTracker.addCloseListener(
+  composeAttachmentTracker.forgetAttachments.bind(composeAttachmentTracker)
+);
 
 this.compose = class extends ExtensionAPI {
   getAPI(context) {
     function getComposeTab(tabId) {
       let tab = tabManager.get(tabId);
       if (tab instanceof TabmailTab) {
         throw new ExtensionError("Not a valid compose window");
       }