1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-23 07:48:48 -05:00

Merge pull request #55 from whiteout-io/dev/wo-321

[WO-321] Show spinner when app is logging in
This commit is contained in:
Felix Hammerl 2014-05-09 10:14:20 +02:00
commit 39fe8f08db
2 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,7 @@ define(function(require) {
self._account = options.account; self._account = options.account;
self._account.busy = false; self._account.busy = false;
self._account.online = false; self._account.online = false;
self._account.loggingIn = false;
// validate email address // validate email address
var emailAddress = self._account.emailAddress; var emailAddress = self._account.emailAddress;
@ -83,6 +84,8 @@ define(function(require) {
EmailDAO.prototype.onConnect = function(options, callback) { EmailDAO.prototype.onConnect = function(options, callback) {
var self = this; var self = this;
self._account.loggingIn = true;
self._imapClient = options.imapClient; self._imapClient = options.imapClient;
self._pgpMailer = options.pgpMailer; self._pgpMailer = options.pgpMailer;
@ -91,6 +94,7 @@ define(function(require) {
imapClient: self._imapClient imapClient: self._imapClient
}, function(err) { }, function(err) {
if (err) { if (err) {
self._account.loggingIn = false;
callback(err); callback(err);
return; return;
} }
@ -101,11 +105,13 @@ define(function(require) {
function onLogin(err) { function onLogin(err) {
if (err) { if (err) {
self._account.loggingIn = false;
callback(err); callback(err);
return; return;
} }
// set status to online // set status to online
self._account.loggingIn = false;
self._account.online = true; self._account.online = true;
// init folders // init folders

View File

@ -23,7 +23,7 @@
</ul><!--/.mail-list--> </ul><!--/.mail-list-->
</div> </div>
<footer ng-class="{syncing: account.busy}" ng-click="synchronize()"> <footer ng-class="{syncing: account.loggingIn || account.busy}" ng-click="synchronize()">
<span class="spinner"></span> <span class="spinner"></span>
<span class="text" ng-switch="account.online"> <span class="text" ng-switch="account.online">
<span ng-switch-when="false"> <span ng-switch-when="false">