mirror of
https://github.com/moparisthebest/mail
synced 2025-01-31 07:00:17 -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',
|
||||
'woDirectives',
|
||||
'woUtil',
|
||||
'woCrypto,',
|
||||
'woCrypto',
|
||||
'woServices',
|
||||
'woEmail',
|
||||
'navigation',
|
||||
|
@ -12,10 +12,13 @@ var INIT_DISPLAY_LEN = 20,
|
||||
NOTIFICATION_INBOX_TIMEOUT = 5000;
|
||||
|
||||
var MailListCtrl = function($scope, $routeParams, statusDisplay, notification, email, keychain, dialog) {
|
||||
|
||||
//
|
||||
// Init
|
||||
//
|
||||
|
||||
$scope.state.mailList = {};
|
||||
|
||||
/**
|
||||
* 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
|
||||
$scope.$root.account = email._account;
|
||||
// TODO: $scope.accounts = account.list();
|
||||
$scope.$root.account = account.list()[0];
|
||||
|
||||
// set notificatio handler for sent messages
|
||||
outbox.onSent = sentNotification;
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var ngModule = angular.module('woServices');
|
||||
var ngModule = angular.module('woEmail');
|
||||
ngModule.service('account', Account);
|
||||
module.exports = Account;
|
||||
|
||||
@ -61,19 +61,20 @@ Account.prototype.init = function(options, callback) {
|
||||
|
||||
// Pre-Flight check: initialize and prepare user's local database
|
||||
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) {
|
||||
return callback(err);
|
||||
return callback(new Error('Updating the internal database failed. Please reinstall the app! Reason: ' + err.message));
|
||||
}
|
||||
|
||||
// Migrate the databases if necessary
|
||||
self._updateHandler.update(function(err) {
|
||||
if (err) {
|
||||
return callback(new Error('Updating the internal database failed. Please reinstall the app! Reason: ' + err.message));
|
||||
}
|
||||
|
||||
prepareKeys();
|
||||
});
|
||||
prepareKeys();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var ngModule = angular.module('woServices');
|
||||
var ngModule = angular.module('woEmail');
|
||||
ngModule.service('email', Email);
|
||||
module.exports = Email;
|
||||
|
||||
@ -57,7 +57,9 @@ function Email(keychain, pgp, accountStore, pgpbuilder, mailreader, dialog) {
|
||||
this._pgpbuilder = pgpbuilder;
|
||||
this._mailreader = mailreader;
|
||||
|
||||
this.onError = dialog.error;
|
||||
this.onError = function(err) {
|
||||
dialog.error(err);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('woEmail', ['woAppConfig', 'woUtil', 'woServices']);
|
||||
angular.module('woEmail', ['woAppConfig', 'woUtil', 'woServices', 'woCrypto']);
|
||||
|
||||
require('./mailreader');
|
||||
require('./pgpbuilder');
|
||||
|
@ -4,7 +4,7 @@ var mailreader = require('mailreader');
|
||||
var config = require('../app-config').config;
|
||||
mailreader.startWorker(config.workerPath + '/mailreader-parser-worker.min.js');
|
||||
|
||||
var ngModule = angular.module('woServices');
|
||||
var ngModule = angular.module('woEmail');
|
||||
ngModule.factory('mailreader', function() {
|
||||
return mailreader;
|
||||
});
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var ngModule = angular.module('woServices');
|
||||
var ngModule = angular.module('woEmail');
|
||||
ngModule.service('outbox', Outbox);
|
||||
module.exports = Outbox;
|
||||
|
||||
|
@ -1,4 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
var ngModule = angular.module('woServices');
|
||||
ngModule.service('pgpbuilder', require('pgpbuilder'));
|
||||
var 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