Bug 1486798 - Do not connect/disconnect when selecting the same page again;r=daisuke

Differential Revision: https://phabricator.services.mozilla.com/D4455

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2018-08-28 15:37:38 +00:00
parent 64682f8e84
commit 658e327202
2 changed files with 7 additions and 1 deletions

View File

@ -14,6 +14,12 @@ const Actions = require("./index");
function selectPage(page) {
return async (dispatch, getState) => {
const currentPage = getState().ui.selectedPage;
if (page === currentPage) {
// Nothing to dispatch if the page is the same as the current page.
return;
}
dispatch({ type: PAGE_SELECTED, page });
if (page === PAGES.THIS_FIREFOX) {

View File

@ -13,7 +13,7 @@ const {
function UiState(locations = []) {
return {
networkLocations: locations,
selectedPage: PAGES.THIS_FIREFOX,
selectedPage: null,
};
}