From 29faabb510641f0142092721691c303d68802029 Mon Sep 17 00:00:00 2001
From: Shane Tomlinson <stomlinson@mozilla.com>
Date: Mon, 22 Aug 2011 16:54:58 -0700
Subject: [PATCH] Only syncing emails if on manage page and if authenticated.

close #200
---
 browserid/static/js/browserid.js | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/browserid/static/js/browserid.js b/browserid/static/js/browserid.js
index 8d88300f4..e3e9f1fa9 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();
   });
 
 
-- 
GitLab