(js) Fix error handling in mail editor popup

pull/237/merge
Francis Lachapelle 2017-08-21 15:22:32 -04:00
parent 4d271a6d85
commit 8df0896028
2 changed files with 6 additions and 4 deletions

1
NEWS
View File

@ -10,6 +10,7 @@ Enhancements
Bug fixes
- [core] yearly repeating events are not shown in web calendar (#4237)
- [web] fixed display of error when the mail editor is in a popup
3.2.10 (2017-07-05)
-------------------

View File

@ -199,13 +199,12 @@
}
function send() {
var ctrls = $parentControllers();
vm.sendState = 'sending';
if (vm.autosave)
$timeout.cancel(vm.autosave);
vm.message.$send().then(function(data) {
var ctrls = $parentControllers();
vm.sendState = 'sent';
if (ctrls.draftMailboxCtrl) {
// We're sending a draft from a popup window and the draft mailbox is opened.
@ -231,8 +230,10 @@
// Let the user see the succesfull message before closing the dialog
$timeout($mdDialog.hide, 1000);
}, function(response) {
vm.sendState = 'error';
vm.errorMessage = response.data? response.data.message : response.statusText;
$timeout(function() {
vm.sendState = 'error';
vm.errorMessage = response.data? response.data.message : response.statusText;
});
});
}