Bug 1498483 - saving current composition doesn't overwrite existing file. r=aceman
authorJorg K <jorgk@jorgk.com>
Sun, 14 Oct 2018 00:31:08 +0200
changeset 33362 2df9fd956bec02951a1b546897a78509df63e476
parent 33361 78ca133d04d61a08ddc78412ca75037011dcb03b
child 33363 dc3c8dc2370a631044218746be0798259cda73f5
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersaceman
bugs1498483
Bug 1498483 - saving current composition doesn't overwrite existing file. r=aceman
editor/ui/composer/content/ComposerCommands.js
--- a/editor/ui/composer/content/ComposerCommands.js
+++ b/editor/ui/composer/content/ComposerCommands.js
@@ -840,17 +840,17 @@ function PromptForSaveLocation(aDoSaveAs
       SetFilePickerDirectory(fp, aEditorType);
     }
   }
   catch(e) {}
 
   return new Promise(resolve => {
     fp.open(rv => {
       dialogResult.filepickerClick = rv;
-      if (rv == nsIFilePicker.returnOK && fp.file) {
+      if (rv != nsIFilePicker.returnCancel && fp.file) {  // Allow OK and replace.
         // reset urlstring to new save location
         dialogResult.resultingURIString = fileHandler.getURLSpecFromFile(fp.file);
         dialogResult.resultingLocalFile = fp.file;
         SaveFilePickerDirectory(fp, aEditorType);
         resolve(dialogResult);
       }
       else if ("gFilePickerDirectory" in window && gFilePickerDirectory) {
         fp.displayDirectory = gFilePickerDirectory;