MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / shouldSeeConsentDialog

Function shouldSeeConsentDialog

src/lib/analytics.js:136–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134 * haven't yet responded to the consent dialog, show it.
135 */
136export 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
150export function denyCampaign(campaignId) {
151 if (!ciActive) {

Callers 1

analyticsConsentMethod · 0.90

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected