From 426a72fe24e2bd2ac04ce9cd31844a5ce67437e5 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Mon, 19 Nov 2012 20:33:08 -0800 Subject: [PATCH] Don't display logging-in animation in onReconnect. --- packages/accounts-base/accounts_client.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/accounts-base/accounts_client.js b/packages/accounts-base/accounts_client.js index 91b126edbf..ef0575953c 100644 --- a/packages/accounts-base/accounts_client.js +++ b/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,