Skip to content

Commit

Permalink
fix(onboarding): open onboarding page on installation
Browse files Browse the repository at this point in the history
  • Loading branch information
bmenant committed Sep 7, 2018
1 parent dc401a3 commit e3a692b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/app/background/actions/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ const onInstalledPromise = new Promise(resolve => {
});
});

export default function () {
export default function ({ onboardingUrl }) {
return dispatch => {
if (onboardingUrl) {
onInstalledPromise.then(() => chrome.tabs.create({ url: onboardingUrl }));
}

onInstalledPromise.then(onInstalledDetails => dispatch({
type: INSTALLED,
onInstalledDetails
}));
};
}
}
3 changes: 2 additions & 1 deletion src/app/background/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ configureStore(store => {
);

if (store.getState().get('prefs').get('onInstalledDetails').isEmpty()) {
store.dispatch(onInstalled());
const onboardingUrl = process.env.ONBOARDING_ORIGIN;
store.dispatch(onInstalled({ onboardingUrl }));
}

store.dispatch(dispatchInitialStateFromBackend()); // store initialization from the kraft server
Expand Down
1 change: 1 addition & 0 deletions webpack/chromium.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default baseConfig({
LMEM_BACKEND_ORIGIN: '"https://recommendations.lmem.net"',
LMEM_SCRIPTS_ORIGIN: "'.'",
UNINSTALL_ORIGIN: "'https://www.lmem.net/desinstallation'",
ONBOARDING_ORIGIN: '"https://bienvenue.lmem.net?extensionInstalled"',
HEAP_APPID: '"3705584166"', // production
}
}
Expand Down
1 change: 1 addition & 0 deletions webpack/firefox.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default baseConfig({
NODE_ENV: '"production"',
LMEM_BACKEND_ORIGIN: '"https://recommendations.lmem.net"',
LMEM_SCRIPTS_ORIGIN: "'.'", // Use local build
ONBOARDING_ORIGIN: '"https://bienvenue.lmem.net?extensionInstalled"',
//HEAP_APPID: '"3705584166"', // No analytics with Firefox
}
},
Expand Down

0 comments on commit e3a692b

Please sign in to comment.