Skip to content

Commit

Permalink
Tours: Rename selector for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed Jun 29, 2020
1 parent b7a99e4 commit 1482098
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/state/ui/guided-tours/selectors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import createSelector from 'lib/create-selector';
import findOngoingTour from './find-ongoing-tour';
import getToursHistory from './get-tours-history';

const DISALLOWED_SECTIONS = [
const SECTIONS_WITHOUT_TOURS = [
'signup',
'upgrades', // checkout
'checkout-thank-you', // thank you page
Expand Down Expand Up @@ -149,7 +149,8 @@ const findTriggeredTour = ( state ) => {
} );
};

const isSectionDisallowed = ( state ) => includes( DISALLOWED_SECTIONS, getSectionName( state ) );
const doesSectionAllowTours = ( state ) =>
! includes( SECTIONS_WITHOUT_TOURS, getSectionName( state ) );

export const hasTourJustBeenVisible = createSelector(
( state, now = Date.now() ) => {
Expand All @@ -163,7 +164,7 @@ export const hasTourJustBeenVisible = createSelector(
[ getActionLog ]
);

const shouldBailAllTours = ( state ) => isSectionDisallowed( state );
const shouldBailAllTours = ( state ) => ! doesSectionAllowTours( state );

const shouldBailNewTours = ( state ) => hasTourJustBeenVisible( state );

Expand Down

0 comments on commit 1482098

Please sign in to comment.