Skip to content

Commit

Permalink
Merge pull request mozilla#1421 from chuckharmston/1419-onboarding-re…
Browse files Browse the repository at this point in the history
…start

Improve forced first-run restart behavior
  • Loading branch information
lmorchard authored Sep 23, 2016
2 parents 97834e6 + d35d58c commit bd66e14
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,11 @@ exports.main = function(options) {
ToolbarButton.init(settings);
ExperimentNotifications.init();
SharePrompt.init(settings);
FirstRun.setup(options.reason, settings);

if (reason === 'install') {
if (reason === 'install' || (reason === 'startup' && FirstRun.isFirstRun())) {
openOnboardingTab();
}
FirstRun.setup(options.reason, settings);

const installedCount = (store.installedAddons) ? Object.keys(store.installedAddons).length : 0;
Metrics.sendGAEvent({
Expand Down
2 changes: 1 addition & 1 deletion addon/lib/first-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {

openTestPilot(settings) {
tabs.open({
url: `${settings.BASE_URL}?${this.utm}`
url: `${settings.BASE_URL}/experiments/?${this.utm}`
});
},

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/components/ExperimentsListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default class ExperimentsListPage extends React.Component {
super(props);

let showEmailDialog = false;
if (cookies.get('first-run')) {
if (cookies.get('first-run') ||
window.location.search.indexOf('utm_campaign=restart-required') > -1) {
cookies.remove('first-run');
showEmailDialog = true;
}
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/app/lib/addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ export function installAddon(store, eventCategory, experimentTitle) {
}
});
} else {
cookies.set('first-run', 'true');
gaEvent.outboundURL = downloadUrl;
sendToGA('event', gaEvent);
}

cookies.set('first-run', 'true');
}

export function uninstallAddon() {
Expand Down

0 comments on commit bd66e14

Please sign in to comment.