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-1971: Replace spring promo with midnight promo in panel #571

Merged
merged 2 commits into from Jun 29, 2020
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -278,7 +278,7 @@ class Panel extends React.Component {
/**
* @returns {null|JSX}
* @private
* Renders the Plus promo modal if the user is not already an subscriber
* Renders the Plus promo modal if the user is not already a Plus subscriber
*/
_renderPlusPromoModal = () => {
if (this._hasPlusAccess() || this._hasPremiumAccess()) { return null; }
@@ -312,10 +312,6 @@ class Panel extends React.Component {
return this._renderInsightsPromoModal();
}

if (promoModal === 'plus') {
return this._renderPlusPromoModal();
}

if (promoModal === 'premium') {
return this._renderPremiumPromoModal();
}
@@ -42,9 +42,9 @@ class PromoModals {
*/
static whichPromoModalShouldWeDisplay() {
// The order is important
// Insights takes priority over Plus
// Insights takes priority over Premium
if (this._isTimeForAPromo(INSIGHTS)) return INSIGHTS;
if (this._isTimeForAPromo(PLUS)) return PLUS;
if (this._isTimeForAPromo(PREMIUM)) return PREMIUM;
return null;
}

@@ -67,9 +67,9 @@ class PromoModals {
static _isTimeForAPromo(type) {
if (conf.notify_promotions === false) { return false; }

const lastSeenPlusPromo = conf[`${PLUS}_${PROMO_MODAL_LAST_SEEN}`];
const lastSeenPremiumPromo = conf[`${PREMIUM}_${PROMO_MODAL_LAST_SEEN}`];
const lastSeenInsightsPromo = conf[`${INSIGHTS}_${PROMO_MODAL_LAST_SEEN}`];
const lastSeenPromo = Math.max(lastSeenPlusPromo, lastSeenInsightsPromo);
const lastSeenPromo = Math.max(lastSeenPremiumPromo, lastSeenInsightsPromo);

if (type === INSIGHTS && !this._hasEngagedFrequently()) {
return false;
ProTip! Use n and p to navigate between commits in a pull request.