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

GH-2033 Update GBE account state in response to checkout-web events #555

Merged
merged 16 commits into from Jun 15, 2020
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Add some TODO comments in background

  • Loading branch information
wlycdgr committed Jun 4, 2020
commit 7bd3dec7c6d0d8bd2377cadfc764a1b473712400
@@ -880,6 +880,7 @@ function onMessageHandler(request, sender, callback) {
}
}

// TODO add function description
function hamGetTheme(callback) {
if (conf.current_theme !== 'default') {
account.getTheme(conf.current_theme)
@@ -892,6 +893,7 @@ function hamGetTheme(callback) {
return false;
}

// TODO add function description
function hamGetUser(payload, callback) {
account.getUser(payload)
.then((user) => {
@@ -911,6 +913,7 @@ function hamGetUser(payload, callback) {
return true;
}

// TODO add function description
function hamGetUserSettings(callback) {
account.getUserSettings()
.then((settings) => {
@@ -923,6 +926,7 @@ function hamGetUserSettings(callback) {
return true;
}

// TODO add function description
function hamGetUserSubscriptionData(callback) {
account.getUserSubscriptionData()
.then((subscriptions) => {
@@ -948,6 +952,7 @@ function hamGetUserSubscriptionData(callback) {
return true;
}

// TODO add function description
function hamLogin(msgData, callback) {
const { email, password } = msgData;

@@ -968,6 +973,7 @@ function hamLogin(msgData, callback) {
return true;
}

// TODO add function description
function hamLogout(callback) {
account.logout()
.then((response) => {
@@ -980,6 +986,7 @@ function hamLogout(callback) {
return true;
}

// TODO add function description
function hamOpenCheckoutPage(utm) {
let url = `${globals.CHECKOUT_BASE_URL}/plus`;
if (utm) {
@@ -990,11 +997,13 @@ function hamOpenCheckoutPage(utm) {
return false;
}

// TODO add function description
function hamOpenSubscriptionPage() {
utils.openNewTab({ url: `${globals.ACCOUNT_BASE_URL}/subscription`, become_active: true });
return false;
}

// TODO add function description
function hamOpenSupportPage() {
const subscriber = account.hasScopesUnverified(['subscriptions:plus']);
const tabUrl = subscriber ? `${globals.ACCOUNT_BASE_URL}/support` : 'https://www.ghostery.com/support/';
@@ -1005,6 +1014,7 @@ function hamOpenSupportPage() {
return false;
}

// TODO add function description
function hamRegister(userDetails, callback) {
const {
email,
@@ -1029,6 +1039,7 @@ function hamRegister(userDetails, callback) {
return true;
}

// TODO add function description
function hamResetPassword(email, callback) {
// TODO check args
account.resetPassword(email)
@@ -1042,6 +1053,7 @@ function hamResetPassword(email, callback) {
return true;
}

// TODO add function description
function hamValidateAccountEmail(callback) {
account.sendValidateAccountEmail()
.then((success) => {
ProTip! Use n and p to navigate between commits in a pull request.