diff options
author | Ed Lee <edilee@mozilla.com> | 2019-05-21 15:19:03 -0700 |
---|---|---|
committer | Ed Lee <edilee@mozilla.com> | 2019-05-21 15:19:03 -0700 |
commit | 1734beda7ff3336efdc3f9b1b490d68d1e6cf507 (patch) | |
tree | b8e3b5b91f5ca50054e563f026c6d6af64232a63 | |
parent | bf8d5425f16604b01f4dd237e001e6e3912856fb (diff) | |
parent | b572c6d72628a9815713a72c71d57e331ff51b31 (diff) |
Merge branch 'trailhead'
-rw-r--r-- | content-src/asrouter/templates/Trailhead/Trailhead.jsx | 13 | ||||
-rw-r--r-- | lib/ASRouter.jsm | 4 | ||||
-rw-r--r-- | lib/OnboardingMessageProvider.jsm | 8 |
3 files changed, 17 insertions, 8 deletions
diff --git a/content-src/asrouter/templates/Trailhead/Trailhead.jsx b/content-src/asrouter/templates/Trailhead/Trailhead.jsx index 8d642782..63dc9a52 100644 --- a/content-src/asrouter/templates/Trailhead/Trailhead.jsx +++ b/content-src/asrouter/templates/Trailhead/Trailhead.jsx @@ -57,20 +57,25 @@ export class _Trailhead extends React.PureComponent { link.rel = "localization"; }); - if (this.props.fxaEndpoint && !this.fxaMetricsInitialized) { + await this.componentWillUpdate(this.props); + } + + // Get the fxa data if we don't have it yet from mount or update + async componentWillUpdate(props) { + if (props.fxaEndpoint && !this.fxaMetricsInitialized) { try { this.fxaMetricsInitialized = true; - const url = new URL(`${this.props.fxaEndpoint}/metrics-flow?entrypoint=activity-stream-firstrun&form_type=email`); + const url = new URL(`${props.fxaEndpoint}/metrics-flow?entrypoint=activity-stream-firstrun&form_type=email`); this.addUtmParams(url); const response = await fetch(url, {credentials: "omit"}); if (response.status === 200) { const {deviceId, flowId, flowBeginTime} = await response.json(); this.setState({deviceId, flowId, flowBeginTime}); } else { - this.props.dispatch(ac.OnlyToMain({type: at.TELEMETRY_UNDESIRED_EVENT, data: {event: "FXA_METRICS_FETCH_ERROR", value: response.status}})); + props.dispatch(ac.OnlyToMain({type: at.TELEMETRY_UNDESIRED_EVENT, data: {event: "FXA_METRICS_FETCH_ERROR", value: response.status}})); } } catch (error) { - this.props.dispatch(ac.OnlyToMain({type: at.TELEMETRY_UNDESIRED_EVENT, data: {event: "FXA_METRICS_ERROR"}})); + props.dispatch(ac.OnlyToMain({type: at.TELEMETRY_UNDESIRED_EVENT, data: {event: "FXA_METRICS_ERROR"}})); } } } diff --git a/lib/ASRouter.jsm b/lib/ASRouter.jsm index c2aef959..7db9f5fc 100644 --- a/lib/ASRouter.jsm +++ b/lib/ASRouter.jsm @@ -62,9 +62,9 @@ const TRAILHEAD_CONFIG = { }, LOCALES: ["en-US", "en-GB", "en-CA", "de", "de-DE", "fr", "fr-FR"], EXPERIMENT_RATIOS: [ - ["", 1], + ["", 0], ["interrupts", 1], - ["triplets", 1], + ["triplets", 3], ], }; diff --git a/lib/OnboardingMessageProvider.jsm b/lib/OnboardingMessageProvider.jsm index b18493eb..e70ae978 100644 --- a/lib/OnboardingMessageProvider.jsm +++ b/lib/OnboardingMessageProvider.jsm @@ -6,6 +6,7 @@ const {Localization} = ChromeUtils.import("resource://gre/modules/Localization.j const {FxAccountsConfig} = ChromeUtils.import("resource://gre/modules/FxAccountsConfig.jsm"); const {AttributionCode} = ChromeUtils.import("resource:///modules/AttributionCode.jsm"); const {AddonRepository} = ChromeUtils.import("resource://gre/modules/addons/AddonRepository.jsm"); +const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); async function getAddonInfo() { try { @@ -223,7 +224,10 @@ const ONBOARDING_MESSAGES = async () => ([ icon: "tracking", primary_button: { label: {string_id: "onboarding-tracking-protection-button2"}, - action: { + action: Services.locale.appLocaleAsLangTag.substr(0, 2) === "en" ? { + type: "OPEN_URL", + data: {args: "https://mzl.la/ETPdefault", where: "tabshifted"}, + } : { type: "OPEN_PREFERENCES_PAGE", data: {category: "privacy-trackingprotection"}, }, @@ -343,7 +347,7 @@ const ONBOARDING_MESSAGES = async () => ([ label: {string_id: "onboarding-send-tabs-button"}, action: { type: "OPEN_URL", - data: {args: "https://support.mozilla.org/kb/send-tab-firefox-desktop-mobile", where: "tabshifted"}, + data: {args: "https://support.mozilla.org/kb/send-tab-firefox-desktop-other-devices", where: "tabshifted"}, }, }, }, |