diff --git a/NEWS b/NEWS index 510847e0c..52ab4681e 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/UI/WebServerResources/js/Mailer/Mailer.app.js b/UI/WebServerResources/js/Mailer/Mailer.app.js index 1d9ec4bce..fa7e35ba6 100644 --- a/UI/WebServerResources/js/Mailer/Mailer.app.js +++ b/UI/WebServerResources/js/Mailer/Mailer.app.js @@ -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); }