Skip to content
Browse files

Don't display logging-in animation in onReconnect.

  • Loading branch information...
1 parent 7cc88dc commit 426a72fe24e2bd2ac04ce9cd31844a5ce67437e5 @glasser glasser committed Nov 19, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 packages/accounts-base/accounts_client.js
View
13 packages/accounts-base/accounts_client.js
@@ -59,7 +59,8 @@
Accounts.callLoginMethod = function (options) {
options = _.extend({
methodName: 'login',
- methodArguments: []
+ methodArguments: [],
+ _suppressLoggingIn: false
}, options);
// Set defaults for callback arguments to no-op functions; make sure we
// override falsey values too.
@@ -92,6 +93,10 @@
reconnected = true;
Accounts.callLoginMethod({
methodArguments: [{resume: result.token}],
+ // Reconnect quiescence ensures that the user doesn't see an
+ // intermediate state before the login method finishes. So we don't
+ // need to show a logging-in animation.
+ _suppressLoggingIn: true,
userCallback: function (error) {
if (error) {
Accounts._makeClientLoggedOut();
@@ -114,7 +119,8 @@
if (reconnected)
return;
- Accounts._setLoggingIn(false);
+ if (!options._suppressLoggingIn)
+ Accounts._setLoggingIn(false);
if (error || !result) {
error = error || new Error(
"No result from call to " + options.methodName);
@@ -133,7 +139,8 @@
options.userCallback();
};
- Accounts._setLoggingIn(true);
+ if (!options._suppressLoggingIn)
+ Accounts._setLoggingIn(true);
Meteor.apply(
options.methodName,
options.methodArguments,

0 comments on commit 426a72f

Please sign in to comment.
Something went wrong with that request. Please try again.