Skip to content

Commit 5457d85

Browse files
committed
Add 'Save starting' notification for put saver
There are two related changes: 1. Add a 'Save starting' notification for the put saver, similar to the upload saver. Not sure if it was intentionally omitted for the put saver, but it seems reasonable to have the two be consistent. 2. Send the 'Save starting' notifications in both upload and put save right before the actual request is sent. While testing I noticed that the save might have failed before the "Save starting" notification appeared which didn't seem useful.
1 parent 4566938 commit 5457d85

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

core/modules/savers/put.js

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ PutSaver.prototype.save = function(text,method,callback) {
8080
if(this.etag) {
8181
headers["If-Match"] = this.etag;
8282
}
83+
$tw.notifier.display("$:/language/Notifications/Save/Starting");
8384
$tw.utils.httpRequest({
8485
url: this.uri(),
8586
type: "PUT",

core/modules/savers/upload.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ UploadSaver.prototype.save = function(text,method,callback) {
6464
var tail = "\r\n--" + boundary + "--\r\n",
6565
data = head.join("\r\n") + text + tail;
6666
// Do the HTTP post
67+
$tw.notifier.display("$:/language/Notifications/Save/Starting");
6768
var http = new XMLHttpRequest();
6869
http.open("POST",url,true,username,password);
6970
http.setRequestHeader("Content-Type","multipart/form-data; charset=UTF-8; boundary=" + boundary);
@@ -81,7 +82,6 @@ UploadSaver.prototype.save = function(text,method,callback) {
8182
} catch(ex) {
8283
return callback($tw.language.getString("Error/Caption") + ":" + ex);
8384
}
84-
$tw.notifier.display("$:/language/Notifications/Save/Starting");
8585
return true;
8686
};
8787

0 commit comments

Comments
 (0)