Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix #1956, even if user.initialize() is called many times, do not kee…
Browse files Browse the repository at this point in the history
…p sending requests to the server
  • Loading branch information
ianb committed Dec 13, 2016
1 parent 738eedf commit 85db7e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addon/lib/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ exports.initialize = function (backend, reason) {
// This lets us retry initialize() with no parameters later if necessary:
cachedBackend = backend = backend || cachedBackend;
cachedReason = reason = reason || cachedReason;
if (initialized && hasCookieForBackend(backend)) {
return Promise.resolve();
}
let deviceIdInfo = getDeviceIdInfo();
return new Promise((resolve, reject) => {
if (! (deviceIdInfo && deviceIdInfo.deviceId && deviceIdInfo.secret)) {
Expand Down

0 comments on commit 85db7e7

Please sign in to comment.