MDL-18014 Atto autosave: Correct detection of autosaving error when session expired
This commit is contained in:
+9
-3
@@ -915,9 +915,15 @@ EditorAutosave.prototype = {
|
||||
Y.log(response, 'warn');
|
||||
this.showMessage(M.util.get_string('autosavefailed', 'editor_atto'), 'warning', AUTOSAVE_FREQUENCY);
|
||||
},
|
||||
success: function() {
|
||||
Y.log('Text auto-saved');
|
||||
this.lastText = newText;
|
||||
success: function(code, response) {
|
||||
if (response !== "") {
|
||||
Y.log('Failure while autosaving text.', 'warn');
|
||||
Y.log(response, 'debug');
|
||||
this.showMessage(M.util.get_string('autosavefailed', 'editor_atto'), 'warning', AUTOSAVE_FREQUENCY);
|
||||
} else {
|
||||
// All working.
|
||||
this.lastText = newText;
|
||||
}
|
||||
}
|
||||
},
|
||||
context: this
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+7
-2
@@ -904,8 +904,13 @@ EditorAutosave.prototype = {
|
||||
failure: function(code, response) {
|
||||
this.showMessage(M.util.get_string('autosavefailed', 'editor_atto'), 'warning', AUTOSAVE_FREQUENCY);
|
||||
},
|
||||
success: function() {
|
||||
this.lastText = newText;
|
||||
success: function(code, response) {
|
||||
if (response !== "") {
|
||||
this.showMessage(M.util.get_string('autosavefailed', 'editor_atto'), 'warning', AUTOSAVE_FREQUENCY);
|
||||
} else {
|
||||
// All working.
|
||||
this.lastText = newText;
|
||||
}
|
||||
}
|
||||
},
|
||||
context: this
|
||||
|
||||
+9
-3
@@ -205,9 +205,15 @@ EditorAutosave.prototype = {
|
||||
Y.log(response, 'warn');
|
||||
this.showMessage(M.util.get_string('autosavefailed', 'editor_atto'), 'warning', AUTOSAVE_FREQUENCY);
|
||||
},
|
||||
success: function() {
|
||||
Y.log('Text auto-saved');
|
||||
this.lastText = newText;
|
||||
success: function(code, response) {
|
||||
if (response !== "") {
|
||||
Y.log('Failure while autosaving text.', 'warn');
|
||||
Y.log(response, 'debug');
|
||||
this.showMessage(M.util.get_string('autosavefailed', 'editor_atto'), 'warning', AUTOSAVE_FREQUENCY);
|
||||
} else {
|
||||
// All working.
|
||||
this.lastText = newText;
|
||||
}
|
||||
}
|
||||
},
|
||||
context: this
|
||||
|
||||
Reference in New Issue
Block a user