This commit is contained in:
Ed Lee 2019-05-21 15:19:03 -07:00
Родитель bf8d5425f1 b572c6d726
Коммит 1734beda7f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 40B7250312F03605
3 изменённых файлов: 17 добавлений и 8 удалений

Просмотреть файл

@ -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"}}));
}
}
}

Просмотреть файл

@ -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],
],
};

Просмотреть файл

@ -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"},
},
},
},