mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
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:
parent
64682f8e84
commit
658e327202
@ -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) {
|
||||
|
@ -13,7 +13,7 @@ const {
|
||||
function UiState(locations = []) {
|
||||
return {
|
||||
networkLocations: locations,
|
||||
selectedPage: PAGES.THIS_FIREFOX,
|
||||
selectedPage: null,
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user