Bug 740956 - Part 2: Make cancelling and uploading repeatable for Filelink. r+a=bienvenu.
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -723,18 +723,20 @@ var attachmentBucketController = {
// If Filelink is disabled, hide this menuitem and bailout.
if (!Services.prefs.getBoolPref("mail.cloud_files.enabled")) {
cmd.hidden = true;
return false;
}
let bucket = document.getElementById("attachmentBucket");
for (let [,item] in Iterator(bucket.selectedItems)) {
- if (item && item.uploading)
+ if (item && item.uploading) {
+ cmd.hidden = false;
return true;
+ }
}
// Hide the command entirely if the selected attachments aren't cloud
// files.
// For some reason, the hidden property isn't propagating from the cmd
// to the menuitem.
cmd.hidden = true;
return false;
@@ -1062,19 +1064,24 @@ uploadListener.prototype = {
attachmentItem.image = null;
}
}
let event = document.createEvent("Events");
event.initEvent("attachment-uploaded", true, true);
attachmentItem.dispatchEvent(event);
}
- else if (aStatusCode == this.cloudProvider.uploadCanceled) {
+ else if (aStatusCode == Components.interfaces
+ .nsIMsgCloudFileProvider
+ .uploadCanceled) {
attachmentItem.setAttribute("tooltiptext", attachmentItem.attachment.url);
attachmentItem.image = null;
+ attachmentItem.uploading = false;
+ attachmentItem.attachment.sendViaCloud = false;
+ delete attachmentItem.cloudProvider;
}
else {
let title;
let msg;
let displayName = cloudFileAccounts.getDisplayName(this.cloudProvider);
let bundle = getComposeBundle();
switch (aStatusCode) {