diff --git a/src/js/controller/write.js b/src/js/controller/write.js index ce7a7c4..b96568b 100644 --- a/src/js/controller/write.js +++ b/src/js/controller/write.js @@ -223,6 +223,9 @@ define(function(require) { attachments: $scope.attachments }; + // close the writer + $scope.state.writer.close(); + // persist the email to disk for later sending outbox.put(email, function(err) { if (err) { @@ -237,15 +240,11 @@ define(function(require) { // mark replyTo as answered, if necessary if ($scope.replyTo && !$scope.replyTo.answered) { $scope.replyTo.answered = true; + // update the ui + $scope.$apply(); 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. // otherwise, we're done if (!needsSync) {