diff --git a/src/js/dao/email-dao.js b/src/js/dao/email-dao.js index c803cb7..8b0c2e1 100644 --- a/src/js/dao/email-dao.js +++ b/src/js/dao/email-dao.js @@ -965,9 +965,6 @@ define(function(require) { return; } - // set status to online - self._account.online = true; - // init folders self._initFolders(function(err) { if (err) { @@ -1009,6 +1006,9 @@ define(function(require) { }); self._imapClient.mailboxCache = mailboxCache; + // set status to online after setting cache to prevent race condition + self._account.online = true; + // set up the imap client to listen for changes in the inbox var inbox = _.findWhere(self._account.folders, { type: 'Inbox'