()
| 134 | * haven't yet responded to the consent dialog, show it. |
| 135 | */ |
| 136 | export function shouldSeeConsentDialog() { |
| 137 | if (!ciActive) { |
| 138 | return; |
| 139 | } |
| 140 | let selected = store.get(SELECTED_FOR_EXPERIMENT_KEY); |
| 141 | if (selected === undefined) { |
| 142 | selected = Math.random() < (PERCENT_OF_ONBOARDERS_TO_PROMPT / 100); |
| 143 | store.set(SELECTED_FOR_EXPERIMENT_KEY, selected); |
| 144 | ci.persist(); |
| 145 | } |
| 146 | const hasResponded = ci.stateOfCampaign(ONBOARDING_CAMPAIGN) !== ConsentState.unknown; |
| 147 | return selected && !hasResponded; |
| 148 | } |
| 149 | |
| 150 | export function denyCampaign(campaignId) { |
| 151 | if (!ciActive) { |
no test coverage detected