Merge pull request #142 from whiteout-io/dev/WO-639

[WO-639] Use 5s timeout for incoming mail
This commit is contained in:
Tankred Hase 2014-10-21 15:13:43 +02:00
commit a610440b5a
3 changed files with 24 additions and 7 deletions

View File

@ -213,5 +213,7 @@ exports.string = {
connDocHostTimeout: 'We could not establish a connection to {0} within {1} ms. Please check the server settings and encryption mode!', connDocHostTimeout: 'We could not establish a connection to {0} within {1} ms. Please check the server settings and encryption mode!',
connDocAuthRejected: 'Your credentials for {0} were rejected. Please check your username and password!', connDocAuthRejected: 'Your credentials for {0} were rejected. Please check your username and password!',
connDocNoInbox: 'We could not detect an IMAP inbox folder on {0}. Please have a look at the FAQ for information on how to fix this error.', connDocNoInbox: 'We could not detect an IMAP inbox folder on {0}. Please have a look at the FAQ for information on how to fix this error.',
connDocGenericError: 'There was an error connecting to {0}: {1}' connDocGenericError: 'There was an error connecting to {0}: {1}',
logoutTitle: 'Logout',
logoutMessage: 'Are you sure you want to logout?'
}; };

View File

@ -4,9 +4,14 @@ var appController = require('../app-controller'),
notification = require('../util/notification'), notification = require('../util/notification'),
emailDao, outboxBo, keychainDao, searchTimeout, firstSelect; emailDao, outboxBo, keychainDao, searchTimeout, firstSelect;
//
// Constants
//
var INIT_DISPLAY_LEN = 20, var INIT_DISPLAY_LEN = 20,
SCROLL_DISPLAY_LEN = 10, SCROLL_DISPLAY_LEN = 10,
FOLDER_TYPE_INBOX = 'Inbox'; FOLDER_TYPE_INBOX = 'Inbox',
NOTIFICATION_INBOX_TIMEOUT = 5000;
var MailListCtrl = function($scope, $routeParams) { var MailListCtrl = function($scope, $routeParams) {
// //
@ -409,7 +414,8 @@ var MailListCtrl = function($scope, $routeParams) {
$scope.select(_.findWhere(currentFolder().messages, { $scope.select(_.findWhere(currentFolder().messages, {
uid: unreadMsgs[0].uid uid: unreadMsgs[0].uid
})); }));
} },
timeout: NOTIFICATION_INBOX_TIMEOUT
}); });
$scope.pendingNotifications.push(note); $scope.pendingNotifications.push(note);
}; };

View File

@ -1,11 +1,20 @@
'use strict'; 'use strict';
var appController = require('../app-controller'), var appController = require('../app-controller'),
config = require('../app-config').config,
notification = require('../util/notification'), notification = require('../util/notification'),
backBtnHandler = require('../util/backbutton-handler'), backBtnHandler = require('../util/backbutton-handler'),
appCfg = require('../app-config'),
config = appCfg.config,
str = appCfg.string,
emailDao, outboxBo; emailDao, outboxBo;
//
// Constants
//
var NOTIFICATION_SENT_TIMEOUT = 2000;
// //
// Controller // Controller
// //
@ -55,8 +64,8 @@ var NavigationCtrl = function($scope, $routeParams, $location) {
$scope.logout = function() { $scope.logout = function() {
$scope.onError({ $scope.onError({
title: 'Logout', title: str.logoutTitle,
message: 'Are you sure you want to logout?', message: str.logoutMessage,
callback: function(confirm) { callback: function(confirm) {
if (confirm) { if (confirm) {
appController.logout(); appController.logout();
@ -118,7 +127,7 @@ var NavigationCtrl = function($scope, $routeParams, $location) {
notification.create({ notification.create({
title: 'Message sent', title: 'Message sent',
message: email.subject, message: email.subject,
timeout: 2000 timeout: NOTIFICATION_SENT_TIMEOUT
}, function() {}); }, function() {});
} }