mirror of
https://github.com/moparisthebest/mail
synced 2024-11-26 10:52:17 -05:00
Close read mode after replying to a message
This commit is contained in:
parent
6f794ff26d
commit
e00f2ecb3d
@ -6,7 +6,7 @@ var util = require('crypto-lib').util;
|
|||||||
// Controller
|
// Controller
|
||||||
//
|
//
|
||||||
|
|
||||||
var WriteCtrl = function($scope, $filter, $q, appConfig, auth, keychain, pgp, email, outbox, dialog, axe) {
|
var WriteCtrl = function($scope, $window, $filter, $q, appConfig, auth, keychain, pgp, email, outbox, dialog, axe, status) {
|
||||||
|
|
||||||
var str = appConfig.string;
|
var str = appConfig.string;
|
||||||
var cfg = appConfig.config;
|
var cfg = appConfig.config;
|
||||||
@ -341,6 +341,10 @@ var WriteCtrl = function($scope, $filter, $q, appConfig, auth, keychain, pgp, em
|
|||||||
|
|
||||||
// close the writer
|
// close the writer
|
||||||
$scope.state.writer.close();
|
$scope.state.writer.close();
|
||||||
|
// close read mode after reply
|
||||||
|
if ($scope.replyTo) {
|
||||||
|
status.setReading(false);
|
||||||
|
}
|
||||||
|
|
||||||
// persist the email to disk for later sending
|
// persist the email to disk for later sending
|
||||||
outbox.put(message, function(err) {
|
outbox.put(message, function(err) {
|
||||||
|
@ -6,11 +6,12 @@ var WriteCtrl = require('../../../../src/js/controller/app/write'),
|
|||||||
Keychain = require('../../../../src/js/service/keychain'),
|
Keychain = require('../../../../src/js/service/keychain'),
|
||||||
Auth = require('../../../../src/js/service/auth'),
|
Auth = require('../../../../src/js/service/auth'),
|
||||||
PGP = require('../../../../src/js/crypto/pgp'),
|
PGP = require('../../../../src/js/crypto/pgp'),
|
||||||
|
Status = require('../../../../src/js/util/status'),
|
||||||
Dialog = require('../../../../src/js/util/dialog');
|
Dialog = require('../../../../src/js/util/dialog');
|
||||||
|
|
||||||
describe('Write controller unit test', function() {
|
describe('Write controller unit test', function() {
|
||||||
var ctrl, scope,
|
var ctrl, scope,
|
||||||
authMock, pgpMock, dialogMock, emailMock, keychainMock, outboxMock,
|
authMock, pgpMock, dialogMock, emailMock, keychainMock, outboxMock, statusMock,
|
||||||
emailAddress, realname;
|
emailAddress, realname;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
@ -21,6 +22,7 @@ describe('Write controller unit test', function() {
|
|||||||
outboxMock = sinon.createStubInstance(Outbox);
|
outboxMock = sinon.createStubInstance(Outbox);
|
||||||
emailMock = sinon.createStubInstance(Email);
|
emailMock = sinon.createStubInstance(Email);
|
||||||
keychainMock = sinon.createStubInstance(Keychain);
|
keychainMock = sinon.createStubInstance(Keychain);
|
||||||
|
statusMock = sinon.createStubInstance(Status);
|
||||||
|
|
||||||
emailAddress = 'fred@foo.com';
|
emailAddress = 'fred@foo.com';
|
||||||
realname = 'Fred Foo';
|
realname = 'Fred Foo';
|
||||||
@ -39,7 +41,8 @@ describe('Write controller unit test', function() {
|
|||||||
pgp: pgpMock,
|
pgp: pgpMock,
|
||||||
email: emailMock,
|
email: emailMock,
|
||||||
outbox: outboxMock,
|
outbox: outboxMock,
|
||||||
dialog: dialogMock
|
dialog: dialogMock,
|
||||||
|
status: statusMock
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -343,6 +346,7 @@ describe('Write controller unit test', function() {
|
|||||||
|
|
||||||
scope.sendToOutbox();
|
scope.sendToOutbox();
|
||||||
|
|
||||||
|
expect(statusMock.setReading.withArgs(false).calledOnce).to.be.true;
|
||||||
expect(outboxMock.put.calledOnce).to.be.true;
|
expect(outboxMock.put.calledOnce).to.be.true;
|
||||||
expect(emailMock.setFlags.calledOnce).to.be.true;
|
expect(emailMock.setFlags.calledOnce).to.be.true;
|
||||||
expect(scope.state.lightbox).to.be.undefined;
|
expect(scope.state.lightbox).to.be.undefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user