Unverified Commit 3409f418 authored by Robert Knight's avatar Robert Knight Committed by Sean Hammond

Only retry fetching the profile, not updating the local state with the result.

The `store.profile.read` operation which fetches the profile is done in
a loop until it succeeds, on the basis that network requests may fail if
connectivity is intermittent. The `update` step should always succeed
however, so move it out of the loop.
parent d26b8f5e
...@@ -57,8 +57,9 @@ function session($q, $rootScope, analytics, annotationUI, auth, ...@@ -57,8 +57,9 @@ function session($q, $rootScope, analytics, annotationUI, auth,
if (authority) { if (authority) {
opts.authority = authority; opts.authority = authority;
} }
return store.profile.read(opts).then(update); return store.profile.read(opts);
}).then(function (session) { }).then(function (session) {
update(session);
lastLoadTime = Date.now(); lastLoadTime = Date.now();
return session; return session;
}).catch(function (err) { }).catch(function (err) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment