diff --git a/browserid/static/js/browserid.js b/browserid/static/js/browserid.js index 8d88300f4fae1be64d1a535723a65fece865b297..e3e9f1fa9e7f62b4febc4c483741e14eac2e46b6 100644 --- a/browserid/static/js/browserid.js +++ b/browserid/static/js/browserid.js @@ -35,20 +35,22 @@ * ***** END LICENSE BLOCK ***** */ $(function() { - if ($('#emailList')) { - display_saved_ids(); - } + BrowserIDNetwork.checkAuth(function(authenticated) { + if (authenticated) { + $("body").addClass("authenticated"); + if ($('#emailList').length) { + display_saved_ids(); + } + } + }); }); function display_saved_ids() { var emails = {}; - BrowserIDIdentities.checkAuthenticationAndSync(function(authenticated) { - if (authenticated) { - $("body").addClass("authenticated"); - emails = getEmails(); - displayEmails(); - } + BrowserIDIdentities.syncIdentities(function() { + emails = getEmails(); + displayEmails(); });