-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(hosting-overview-refinements): fix rendering atomic website as simple #93843
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,15 @@ import { FEATURE_SFTP, getPlan, PLAN_BUSINESS } from '@automattic/calypso-produc | |
import page from '@automattic/calypso-router'; | ||
import { Dialog } from '@automattic/components'; | ||
import { useHasEnTranslation } from '@automattic/i18n-utils'; | ||
import { useQueryClient } from '@tanstack/react-query'; | ||
import { Button, Spinner } from '@wordpress/components'; | ||
import { translate } from 'i18n-calypso'; | ||
import { useRef, useState, useEffect } from 'react'; | ||
import { AnyAction } from 'redux'; | ||
import EligibilityWarnings from 'calypso/blocks/eligibility-warnings'; | ||
import { HostingCard } from 'calypso/components/hosting-card'; | ||
import InlineSupportLink from 'calypso/components/inline-support-link'; | ||
import { queryKeyForAllSitesWithThemeSlug } from 'calypso/data/sites/use-site-excerpts-query'; | ||
import { useSiteTransferStatusQuery } from 'calypso/landing/stepper/hooks/use-site-transfer/query'; | ||
import { useSelector, useDispatch } from 'calypso/state'; | ||
import { recordTracksEvent } from 'calypso/state/analytics/actions'; | ||
|
@@ -40,6 +42,7 @@ const PromoCard = ( { title, text, supportContext }: PromoCardProps ) => ( | |
|
||
const HostingFeatures = () => { | ||
const dispatch = useDispatch(); | ||
const queryClient = useQueryClient(); | ||
const { searchParams } = new URL( document.location.toString() ); | ||
const showActivationModal = searchParams.get( 'activate' ) !== null; | ||
const [ showEligibility, setShowEligibility ] = useState( showActivationModal ); | ||
|
@@ -91,8 +94,11 @@ const HostingFeatures = () => { | |
|
||
if ( siteTransferData?.status === transferStates.COMPLETED ) { | ||
dispatch( fetchAtomicTransfer( siteId ) as unknown as AnyAction ); | ||
queryClient.invalidateQueries( { | ||
queryKey: queryKeyForAllSitesWithThemeSlug, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should use By specifying a shorter key when invalidating queries, This seems like an appropriate case to make use of that. We can invalidate all Thoughts, @nightnei? |
||
} ); | ||
} | ||
}, [ siteTransferData?.status, siteId, dispatch ] ); | ||
}, [ siteTransferData?.status, siteId, dispatch, queryClient ] ); | ||
|
||
const upgradeLink = `https://wordpress.com/checkout/${ encodeURIComponent( siteSlug ) }/business`; | ||
const promoCards = [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing the loop: I mentioned on Slack that I think we should replace this with a
getUseSiteExcerptsQueryKey
function. That function should be used internally inuseSiteExcerptsQuery
and when invalidating the query.