mirror of
https://github.com/moparisthebest/mail
synced 2025-02-07 10:30:18 -05:00
Fix show messages on initial login/folder-sync
This commit is contained in:
parent
6ca1ae6507
commit
f0f0aa3d63
@ -66,9 +66,21 @@ define(function(require) {
|
||||
// init folders
|
||||
initFolders();
|
||||
// select inbox as the current folder on init
|
||||
$scope.openFolder($scope.account.folders[0]);
|
||||
if ($scope.account.folders && $scope.account.folders.length > 0) {
|
||||
$scope.openFolder($scope.account.folders[0]);
|
||||
}
|
||||
// connect imap/smtp clients on first startup
|
||||
appController.onConnect($scope.onError);
|
||||
appController.onConnect(function(err) {
|
||||
if (err) {
|
||||
$scope.onError(err);
|
||||
return;
|
||||
}
|
||||
|
||||
// select inbox if not yet selected
|
||||
if (!$scope.state.nav.currentFolder) {
|
||||
$scope.openFolder($scope.account.folders[0]);
|
||||
}
|
||||
});
|
||||
|
||||
//
|
||||
// helper functions
|
||||
|
@ -73,23 +73,7 @@ define(function(require) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if empty (first time login) use dummy folders ... overwritten in onConnect
|
||||
self._account.folders = (folders) ? folders : [{
|
||||
type: 'Inbox',
|
||||
path: 'INBOX'
|
||||
}, {
|
||||
type: 'Sent',
|
||||
path: 'SENT'
|
||||
}, {
|
||||
type: 'Outbox',
|
||||
path: 'OUTBOX'
|
||||
}, {
|
||||
type: 'Drafts',
|
||||
path: 'DRAFTS'
|
||||
}, {
|
||||
type: 'Trash',
|
||||
path: 'TRASH'
|
||||
}];
|
||||
self._account.folders = folders;
|
||||
|
||||
callback(null, keypair);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user