Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding return after rejects in a few places. Implementing Ghostery side of GH-885. Fix for GH-871. #10

Merged
merged 10 commits into from Mar 23, 2018
Next

Adding return after rejects in a few places.

  • Loading branch information
Serge Zarembsky
Serge Zarembsky committed Mar 20, 2018
commit 54b5286e10b52eb807f05b79221ae08f24eb56bd
@@ -200,6 +200,7 @@ function getSiteData() {

if (!tab) {
reject(new Error('Tab not found. Cannot gather page data'));
return;
}

resolve({
@@ -72,9 +72,7 @@ class Metrics {
prefsSet({
utm_source: this.utm_source,
utm_campaign: this.utm_campaign
})
.then(prefs => resolve(prefs))
.catch(err => reject(err));
});
});
resolve();
});
@@ -95,9 +93,7 @@ class Metrics {
prefsSet({
utm_source: this.utm_source,
utm_campaign: this.utm_campaign
})
.then(reject)
.catch(reject);
});
}
});
resolve();
@@ -534,11 +534,13 @@ function _refreshToken() {
return new Promise((resolve, reject) => {
if (!conf.login_info.logged_in) {
resolve('User not logged in');
return;
}

const decoded_user_token = conf.login_info.decoded_user_token;
if (!decoded_user_token || !decoded_user_token.exp) {
reject('User token is corrupted or null');
return;
}

const currentTime = (new Date()).getTime();
ProTip! Use n and p to navigate between commits in a pull request.