Skip to content

Commit

Permalink
Don't show site choice if there is a selected site
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 authored and zaguiini committed Dec 24, 2024
1 parent bba7f80 commit 6932dd5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DIFMStartingPoint: Step = function ( { navigation } ) {
const translate = useTranslate();
const existingSiteCount = useSelector( ( state ) => getCurrentUserSiteCount( state ) );
const siteId = useSite()?.ID;
const showNewOrExistingSiteChoice = existingSiteCount > 0;
const showNewOrExistingSiteChoice = ! siteId && existingSiteCount > 0;

const onSubmit = ( value: string ) => {
submit?.( {
Expand All @@ -39,7 +39,7 @@ const DIFMStartingPoint: Step = function ( { navigation } ) {
showNewOrExistingSiteChoice ? onSubmit( 'existing-site' ) : onSubmit( 'new-site' )
}
onSecondarySubmit={ () => onSubmit( 'new-site' ) }
showNewOrExistingSiteChoice={ existingSiteCount }
showNewOrExistingSiteChoice={ showNewOrExistingSiteChoice }
siteId={ siteId }
isStoreFlow={ false }
/>
Expand Down

0 comments on commit 6932dd5

Please sign in to comment.