Fix angular bootstrap errors

This commit is contained in:
Tankred Hase 2014-11-20 22:53:30 +01:00
parent 7eeff8ec75
commit 198118571f
9 changed files with 31 additions and 21 deletions

View File

@ -54,7 +54,7 @@ var app = angular.module('mail', [
'woAppConfig',
'woDirectives',
'woUtil',
'woCrypto,',
'woCrypto',
'woServices',
'woEmail',
'navigation',

View File

@ -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
*/

View File

@ -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;

View File

@ -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();
});
}

View File

@ -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);
};
}

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('woEmail', ['woAppConfig', 'woUtil', 'woServices']);
angular.module('woEmail', ['woAppConfig', 'woUtil', 'woServices', 'woCrypto']);
require('./mailreader');
require('./pgpbuilder');

View File

@ -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;
});

View File

@ -1,6 +1,6 @@
'use strict';
var ngModule = angular.module('woServices');
var ngModule = angular.module('woEmail');
ngModule.service('outbox', Outbox);
module.exports = Outbox;

View File

@ -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;
});