diff --git a/src/js/controller/app/read.js b/src/js/controller/app/read.js index 0a24db2..2f5ecad 100644 --- a/src/js/controller/app/read.js +++ b/src/js/controller/app/read.js @@ -52,16 +52,6 @@ var ReadCtrl = function($scope, $location, $q, email, invitation, outbox, pgp, k status.setReading(false); }; - $scope.decrypt = function(message) { - return $q(function(resolve) { - resolve(); - }).then(function() { - return email.decryptBody({ - message: message - }); - }); - }; - $scope.getKeyId = function(address) { if ($location.search().dev || !address) { return; diff --git a/src/js/directive/read.js b/src/js/directive/read.js index df16597..8640ea0 100644 --- a/src/js/directive/read.js +++ b/src/js/directive/read.js @@ -92,18 +92,7 @@ ngModule.directive('frameLoad', function($window) { function displayContent() { var mail = scope.state.mailList.selected; - if (!mail) { - return; - } - - if (mail.encrypted && !mail.decrypted) { - // decrypt current mail - scope.decrypt(mail).then(function() { - if (scope.state.mailList.selected === mail && mail.decrypted) { - // decrypted mail is still selected, immidiately show body - displayContent(); - } - }); + if (!mail || (mail.encrypted && !mail.decrypted)) { return; } diff --git a/test/unit/controller/app/read-ctrl-test.js b/test/unit/controller/app/read-ctrl-test.js index 7fb7486..3dba37d 100644 --- a/test/unit/controller/app/read-ctrl-test.js +++ b/test/unit/controller/app/read-ctrl-test.js @@ -63,21 +63,6 @@ describe('Read Controller unit test', function() { }); }); - describe('decrypt', function() { - it('should decrypt a message', function(done) { - var msg = {}; - - emailMock.decryptBody.withArgs({ - message: msg - }).returns(resolves()); - - scope.decrypt(msg).then(function() { - expect(emailMock.decryptBody.calledOnce).to.be.true; - done(); - }); - }); - }); - describe('getKeyId', function() { var address = 'asfd@asdf.com';