mirror of
https://github.com/moparisthebest/mail
synced 2025-02-12 05:00:19 -05:00
Fix angular bootstrap errors
This commit is contained in:
parent
7eeff8ec75
commit
198118571f
@ -54,7 +54,7 @@ var app = angular.module('mail', [
|
|||||||
'woAppConfig',
|
'woAppConfig',
|
||||||
'woDirectives',
|
'woDirectives',
|
||||||
'woUtil',
|
'woUtil',
|
||||||
'woCrypto,',
|
'woCrypto',
|
||||||
'woServices',
|
'woServices',
|
||||||
'woEmail',
|
'woEmail',
|
||||||
'navigation',
|
'navigation',
|
||||||
|
@ -12,10 +12,13 @@ var INIT_DISPLAY_LEN = 20,
|
|||||||
NOTIFICATION_INBOX_TIMEOUT = 5000;
|
NOTIFICATION_INBOX_TIMEOUT = 5000;
|
||||||
|
|
||||||
var MailListCtrl = function($scope, $routeParams, statusDisplay, notification, email, keychain, dialog) {
|
var MailListCtrl = function($scope, $routeParams, statusDisplay, notification, email, keychain, dialog) {
|
||||||
|
|
||||||
//
|
//
|
||||||
// Init
|
// Init
|
||||||
//
|
//
|
||||||
|
|
||||||
|
$scope.state.mailList = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gathers unread notifications to be cancelled later
|
* Gathers unread notifications to be cancelled later
|
||||||
*/
|
*/
|
||||||
|
@ -104,8 +104,7 @@ var NavigationCtrl = function($scope, $routeParams, $location, account, email, o
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get pointer to account/folder/message tree on root scope
|
// get pointer to account/folder/message tree on root scope
|
||||||
$scope.$root.account = email._account;
|
$scope.$root.account = account.list()[0];
|
||||||
// TODO: $scope.accounts = account.list();
|
|
||||||
|
|
||||||
// set notificatio handler for sent messages
|
// set notificatio handler for sent messages
|
||||||
outbox.onSent = sentNotification;
|
outbox.onSent = sentNotification;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ngModule = angular.module('woServices');
|
var ngModule = angular.module('woEmail');
|
||||||
ngModule.service('account', Account);
|
ngModule.service('account', Account);
|
||||||
module.exports = Account;
|
module.exports = Account;
|
||||||
|
|
||||||
@ -61,19 +61,20 @@ Account.prototype.init = function(options, callback) {
|
|||||||
|
|
||||||
// Pre-Flight check: initialize and prepare user's local database
|
// Pre-Flight check: initialize and prepare user's local database
|
||||||
function prepareDatabase() {
|
function prepareDatabase() {
|
||||||
self._accountStore.init(options.emailAddress, function(err) {
|
try {
|
||||||
|
self._accountStore.init(options.emailAddress);
|
||||||
|
} catch (err) {
|
||||||
|
callback(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Migrate the databases if necessary
|
||||||
|
self._updateHandler.update(function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(new Error('Updating the internal database failed. Please reinstall the app! Reason: ' + err.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrate the databases if necessary
|
prepareKeys();
|
||||||
self._updateHandler.update(function(err) {
|
|
||||||
if (err) {
|
|
||||||
return callback(new Error('Updating the internal database failed. Please reinstall the app! Reason: ' + err.message));
|
|
||||||
}
|
|
||||||
|
|
||||||
prepareKeys();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ngModule = angular.module('woServices');
|
var ngModule = angular.module('woEmail');
|
||||||
ngModule.service('email', Email);
|
ngModule.service('email', Email);
|
||||||
module.exports = Email;
|
module.exports = Email;
|
||||||
|
|
||||||
@ -57,7 +57,9 @@ function Email(keychain, pgp, accountStore, pgpbuilder, mailreader, dialog) {
|
|||||||
this._pgpbuilder = pgpbuilder;
|
this._pgpbuilder = pgpbuilder;
|
||||||
this._mailreader = mailreader;
|
this._mailreader = mailreader;
|
||||||
|
|
||||||
this.onError = dialog.error;
|
this.onError = function(err) {
|
||||||
|
dialog.error(err);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('woEmail', ['woAppConfig', 'woUtil', 'woServices']);
|
angular.module('woEmail', ['woAppConfig', 'woUtil', 'woServices', 'woCrypto']);
|
||||||
|
|
||||||
require('./mailreader');
|
require('./mailreader');
|
||||||
require('./pgpbuilder');
|
require('./pgpbuilder');
|
||||||
|
@ -4,7 +4,7 @@ var mailreader = require('mailreader');
|
|||||||
var config = require('../app-config').config;
|
var config = require('../app-config').config;
|
||||||
mailreader.startWorker(config.workerPath + '/mailreader-parser-worker.min.js');
|
mailreader.startWorker(config.workerPath + '/mailreader-parser-worker.min.js');
|
||||||
|
|
||||||
var ngModule = angular.module('woServices');
|
var ngModule = angular.module('woEmail');
|
||||||
ngModule.factory('mailreader', function() {
|
ngModule.factory('mailreader', function() {
|
||||||
return mailreader;
|
return mailreader;
|
||||||
});
|
});
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ngModule = angular.module('woServices');
|
var ngModule = angular.module('woEmail');
|
||||||
ngModule.service('outbox', Outbox);
|
ngModule.service('outbox', Outbox);
|
||||||
module.exports = Outbox;
|
module.exports = Outbox;
|
||||||
|
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ngModule = angular.module('woServices');
|
var PgpBuilder = require('pgpbuilder');
|
||||||
ngModule.service('pgpbuilder', require('pgpbuilder'));
|
var instance = new PgpBuilder();
|
||||||
|
|
||||||
|
var ngModule = angular.module('woEmail');
|
||||||
|
ngModule.factory('pgpbuilder', function() {
|
||||||
|
return instance;
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user