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

Ghostery Plus & Insights Promo Modals #464

Merged
merged 13 commits into from Oct 28, 2019
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Make sure we only repop modals after login through modal if user does…

… not have appropriate sub(s)
  • Loading branch information
wlycdgr committed Oct 25, 2019
commit 27189bc06883a827b91c0f873f6edd7793402aa7
@@ -211,7 +211,9 @@ class Panel extends React.Component {
this.props.history.push('/login');
}

_renderPlusPromoUpgradeModal(signedIn) {
_renderPlusPromoUpgradeModal() {
const { loggedIn } = this.props;

const contentClassNames = ClassNames(
'PlusPromoModal__content',
'flex-container',
@@ -239,7 +241,7 @@ class Panel extends React.Component {
</div>
<div className="PlusPromoModal__text-link-container">
{
!signedIn &&
!loggedIn &&
(
<div onClick={this._handleSubscriberSignInClick} className="PlusPromoModal__text-link">
{t('already_subscribed_sign_in')}
@@ -255,22 +257,16 @@ class Panel extends React.Component {
);
}

_signedIn = () => {
const { account } = this.props;

return account && account.user;
}

_plusSubscriber = () => {
const { account } = this.props;
const { loggedIn, user } = this.props;

return this._signedIn() && account.user.subscriptionsPlus;
return loggedIn && (user && user.subscriptionsPlus);
}

_insightsSubscriber = () => {
const { account } = this.props;
const { loggedIn, user } = this.props;

return this._signedIn() && account.user.scopes && account.user.scopes.includes('subscriptions:insights');
return loggedIn && (user && user.scopes && user.scopes.includes('subscriptions:insights'));
}

_renderPlusPromoModal = () => {
@@ -279,7 +275,7 @@ class Panel extends React.Component {
sendMessage('promoModals.sawPlusPromo', {});

if (this.props.promoModal === 'plus_upgrade') {
return this._renderPlusPromoUpgradeModal(this._signedIn());
return this._renderPlusPromoUpgradeModal();
}

// promoModal === 'plus_initial'
@@ -767,10 +767,6 @@ class Metrics {
conf.metrics.engaged_daily_count = engaged_daily_count;
conf.metrics.engaged_daily_velocity = engaged_daily_velocity;
this._sendReq('engaged', ['daily', 'weekly', 'monthly']);

console.error('IVZ Metrics#_recordEngaged');
console.error(`engaged_daily_count: ${engaged_daily_count}`);
console.error(`engaged_daily_velocity: ${engaged_daily_velocity}`);
}

/**
ProTip! Use n and p to navigate between commits in a pull request.