diff --git a/projects/packages/my-jetpack/_inc/admin.jsx b/projects/packages/my-jetpack/_inc/admin.jsx index dd290eab4c4f6..5ec699fd74264 100644 --- a/projects/packages/my-jetpack/_inc/admin.jsx +++ b/projects/packages/my-jetpack/_inc/admin.jsx @@ -30,7 +30,7 @@ import { import RedeemTokenScreen from './components/redeem-token-screen'; import NoticeContextProvider from './context/notices/noticeContext'; import './style.module.scss'; -import getMyJetpackWindowState from './data/utils/get-my-jetpack-window-state'; +import { getMyJetpackWindowInitialState } from './data/utils/get-my-jetpack-window-state'; /** * Component to scroll window to top on route change. @@ -46,7 +46,7 @@ function ScrollToTop() { const MyJetpack = () => { const queryClient = new QueryClient(); - const { loadAddLicenseScreen } = getMyJetpackWindowState(); + const { loadAddLicenseScreen } = getMyJetpackWindowInitialState(); return ( diff --git a/projects/packages/my-jetpack/_inc/components/add-license-screen/index.jsx b/projects/packages/my-jetpack/_inc/components/add-license-screen/index.jsx index a6f645dbf15c9..f646d29e6dc04 100644 --- a/projects/packages/my-jetpack/_inc/components/add-license-screen/index.jsx +++ b/projects/packages/my-jetpack/_inc/components/add-license-screen/index.jsx @@ -10,7 +10,7 @@ import React, { useCallback, useState, useMemo } from 'react'; */ import { QUERY_LICENSES_KEY } from '../../data/constants'; import useJetpackApiQuery from '../../data/use-jetpack-api-query'; -import getMyJetpackWindowState from '../../data/utils/get-my-jetpack-window-state'; +import { getMyJetpackWindowInitialState } from '../../data/utils/get-my-jetpack-window-state'; import useAnalytics from '../../hooks/use-analytics'; import GoBackLink from '../go-back-link'; @@ -50,7 +50,7 @@ export default function AddLicenseScreen() { [ licenses ] ); - const { siteSuffix = '', adminUrl = '' } = getMyJetpackWindowState(); + const { siteSuffix = '', adminUrl = '' } = getMyJetpackWindowInitialState(); return ( diff --git a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx index bb50488089426..fd17496e9af60 100644 --- a/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx +++ b/projects/packages/my-jetpack/_inc/components/my-jetpack-screen/index.jsx @@ -29,7 +29,7 @@ import { } from '../../data/constants'; import useProduct from '../../data/products/use-product'; import useSimpleQuery from '../../data/use-simple-query'; -import getMyJetpackWindowState from '../../data/utils/get-my-jetpack-window-state'; +import { getMyJetpackWindowInitialState } from '../../data/utils/get-my-jetpack-window-state'; import useAnalytics from '../../hooks/use-analytics'; import useConnectionWatcher from '../../hooks/use-connection-watcher'; import ConnectionsSection from '../connections-section'; @@ -94,9 +94,9 @@ const GlobalNotice = ( { message, options } ) => { */ export default function MyJetpackScreen() { useConnectionWatcher(); - const { hasBeenDismissed = false } = getMyJetpackWindowState( 'welcomeBanner' ); - const { showFullJetpackStatsCard = false } = getMyJetpackWindowState( 'myJetpackFlags' ); - const { jetpackManage = {}, adminUrl } = getMyJetpackWindowState(); + const { hasBeenDismissed = false } = getMyJetpackWindowInitialState( 'welcomeBanner' ); + const { showFullJetpackStatsCard = false } = getMyJetpackWindowInitialState( 'myJetpackFlags' ); + const { jetpackManage = {}, adminUrl } = getMyJetpackWindowInitialState(); const { currentNotice } = useContext( NoticeContext ); const { message, options } = currentNotice || {}; @@ -116,7 +116,7 @@ export default function MyJetpackScreen() { const shouldShowZendeskChatWidget = ! isJwtLoading && ! isChatAvailabilityLoading && isAvailable && jwt; - const isNewUser = getMyJetpackWindowState( 'userIsNewToJetpack' ) === '1'; + const isNewUser = getMyJetpackWindowInitialState( 'userIsNewToJetpack' ) === '1'; const { recordEvent } = useAnalytics(); const [ reloading, setReloading ] = useState( false ); diff --git a/projects/packages/my-jetpack/_inc/components/plans-section/index.jsx b/projects/packages/my-jetpack/_inc/components/plans-section/index.jsx index 69f61590000b4..3e0b91a2ba2e3 100644 --- a/projects/packages/my-jetpack/_inc/components/plans-section/index.jsx +++ b/projects/packages/my-jetpack/_inc/components/plans-section/index.jsx @@ -3,7 +3,7 @@ import { __, _n } from '@wordpress/i18n'; import { useCallback } from 'react'; import { QUERY_PURCHASES_KEY, REST_API_SITE_PURCHASES_ENDPOINT } from '../../data/constants'; import useSimpleQuery from '../../data/use-simple-query'; -import getMyJetpackWindowState from '../../data/utils/get-my-jetpack-window-state'; +import { getMyJetpackWindowInitialState } from '../../data/utils/get-my-jetpack-window-state'; import useAnalytics from '../../hooks/use-analytics'; import useMyJetpackConnection from '../../hooks/use-my-jetpack-connection'; import useMyJetpackNavigate from '../../hooks/use-my-jetpack-navigate'; @@ -123,7 +123,7 @@ function PlanSectionFooter( { numberOfPurchases } ) { ); } - const { loadAddLicenseScreen = '', adminUrl = '' } = getMyJetpackWindowState(); + const { loadAddLicenseScreen = '', adminUrl = '' } = getMyJetpackWindowInitialState(); return (