Skip to content

Commit

Permalink
(js) Improve handling of IMAP timeout handling
Browse files Browse the repository at this point in the history
For external accounts only.
  • Loading branch information
cgx committed Apr 21, 2017
1 parent ab50a41 commit 2b4e357
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -6,6 +6,7 @@ New features

Enhancements
- [core] improved event initation for all day events (#4145)
- [web] improved interface refresh time with external IMAP accounts

Bug fixes
- [web] fixed attachment path when inside multiple body parts
Expand Down
17 changes: 11 additions & 6 deletions UI/WebServerResources/js/Mailer/Mailer.app.js
Expand Up @@ -146,16 +146,21 @@
/**
* @ngInject
*/
stateAccounts.$inject = ['$q', 'Account'];
function stateAccounts($q, Account) {
var accounts = Account.$findAll(window.mailAccounts),
stateAccounts.$inject = ['$window', '$q', 'Account'];
function stateAccounts($window, $q, Account) {
var accounts = Account.$findAll($window.mailAccounts),
promises = [];
// Fetch list of mailboxes for each account
angular.forEach(accounts, function(account, i) {
var mailboxes = account.$getMailboxes();
promises.push(mailboxes.then(function(objects) {
return account;
}));
if (i === 0)
// Make sure we have the list of mailboxes of the first account
promises.push(mailboxes.then(function(objects) {
return account;
}));
else
// Don't wait for external accounts
promises.push(account);
});
return $q.all(promises);
}
Expand Down

0 comments on commit 2b4e357

Please sign in to comment.