close writer before putting to outbox

This commit is contained in:
Tankred Hase 2014-02-25 21:05:59 +01:00
parent 86c0f04973
commit b59ca4a773
1 changed files with 5 additions and 6 deletions

View File

@ -223,6 +223,9 @@ define(function(require) {
attachments: $scope.attachments attachments: $scope.attachments
}; };
// close the writer
$scope.state.writer.close();
// persist the email to disk for later sending // persist the email to disk for later sending
outbox.put(email, function(err) { outbox.put(email, function(err) {
if (err) { if (err) {
@ -237,15 +240,11 @@ define(function(require) {
// mark replyTo as answered, if necessary // mark replyTo as answered, if necessary
if ($scope.replyTo && !$scope.replyTo.answered) { if ($scope.replyTo && !$scope.replyTo.answered) {
$scope.replyTo.answered = true; $scope.replyTo.answered = true;
// update the ui
$scope.$apply();
needsSync = true; needsSync = true;
} }
// close the writer
$scope.state.writer.close();
// update the ui the scope
$scope.$apply();
// if we need to synchronize replyTo.answered, let's do that. // if we need to synchronize replyTo.answered, let's do that.
// otherwise, we're done // otherwise, we're done
if (!needsSync) { if (!needsSync) {