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-1774 et al; promo modal logic bug fixes #468

Merged
merged 2 commits into from Oct 29, 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

Prev

Show first Insights modal as soon as engagement conditions are met

  • Loading branch information
wlycdgr committed Oct 29, 2019
commit d8fa5d4ee53f7a8367d01f1476705dd8b601ab7c
@@ -16,8 +16,8 @@ import globals from './Globals';
import panelData from './PanelData';

const DAYS_BETWEEN_PROMOS = {
plus: globals.DEBUG ? 0.00025 : 30,
insights: globals.DEBUG ? 0.00025 : 30
plus: globals.DEBUG ? 0.0005 : 30,
insights: globals.DEBUG ? 0.0005 : 30
};
const WEEKLY_INSIGHTS_TARGET = globals.DEBUG ? 1 : 3;
const DAILY_INSIGHTS_TARGET = globals.DEBUG ? 7 : 3;
@@ -68,6 +68,11 @@ class PromoModals {
return false;
}

// don't wait 30 days to show the first Insights promo if user meets the criteria before then
if (type === INSIGHTS && lastSeenInsightsPromo === 0) {
return true;
}

return (
(Date.now() - lastSeenPromo) >
(MSECS_IN_DAY * DAYS_BETWEEN_PROMOS[type])
ProTip! Use n and p to navigate between commits in a pull request.