From 19958367360ebd1bad0b01ff00b744bd5943c870 Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Fri, 17 Oct 2014 11:17:40 +0200 Subject: [PATCH] [WO-639] Use 5s timeout for incoming mail --- src/js/app-config.js | 4 +++- src/js/controller/mail-list.js | 10 ++++++++-- src/js/controller/navigation.js | 17 +++++++++++++---- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/js/app-config.js b/src/js/app-config.js index fe3e99e..bf0d5dd 100644 --- a/src/js/app-config.js +++ b/src/js/app-config.js @@ -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!', 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.', - 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?' }; \ No newline at end of file diff --git a/src/js/controller/mail-list.js b/src/js/controller/mail-list.js index 280c63d..313757b 100644 --- a/src/js/controller/mail-list.js +++ b/src/js/controller/mail-list.js @@ -4,9 +4,14 @@ var appController = require('../app-controller'), notification = require('../util/notification'), emailDao, outboxBo, keychainDao, searchTimeout, firstSelect; +// +// Constants +// + var INIT_DISPLAY_LEN = 20, SCROLL_DISPLAY_LEN = 10, - FOLDER_TYPE_INBOX = 'Inbox'; + FOLDER_TYPE_INBOX = 'Inbox', + NOTIFICATION_INBOX_TIMEOUT = 5000; var MailListCtrl = function($scope, $routeParams) { // @@ -409,7 +414,8 @@ var MailListCtrl = function($scope, $routeParams) { $scope.select(_.findWhere(currentFolder().messages, { uid: unreadMsgs[0].uid })); - } + }, + timeout: NOTIFICATION_INBOX_TIMEOUT }); $scope.pendingNotifications.push(note); }; diff --git a/src/js/controller/navigation.js b/src/js/controller/navigation.js index a661f7c..ddab43b 100644 --- a/src/js/controller/navigation.js +++ b/src/js/controller/navigation.js @@ -1,11 +1,20 @@ 'use strict'; var appController = require('../app-controller'), - config = require('../app-config').config, notification = require('../util/notification'), backBtnHandler = require('../util/backbutton-handler'), + appCfg = require('../app-config'), + config = appCfg.config, + str = appCfg.string, emailDao, outboxBo; +// +// Constants +// + +var NOTIFICATION_SENT_TIMEOUT = 2000; + + // // Controller // @@ -55,8 +64,8 @@ var NavigationCtrl = function($scope, $routeParams, $location) { $scope.logout = function() { $scope.onError({ - title: 'Logout', - message: 'Are you sure you want to logout?', + title: str.logoutTitle, + message: str.logoutMessage, callback: function(confirm) { if (confirm) { appController.logout(); @@ -118,7 +127,7 @@ var NavigationCtrl = function($scope, $routeParams, $location) { notification.create({ title: 'Message sent', message: email.subject, - timeout: 2000 + timeout: NOTIFICATION_SENT_TIMEOUT }, function() {}); }