mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
♻️ Remove duplicate “common.isReady” accessor
This commit is contained in:
parent
161df3a85f
commit
0867a3cc63
3 changed files with 3 additions and 6 deletions
|
@ -11,8 +11,8 @@ import { getQuery } from '../utils/navigation';
|
||||||
const SettingsApp = () => {
|
const SettingsApp = () => {
|
||||||
const { isReady: onboardingIsReady, completed: onboardingCompleted } =
|
const { isReady: onboardingIsReady, completed: onboardingCompleted } =
|
||||||
OnboardingHooks.useSteps();
|
OnboardingHooks.useSteps();
|
||||||
|
const { isReady: merchantIsReady } = CommonHooks.useStore();
|
||||||
const {
|
const {
|
||||||
isReady: merchantIsReady,
|
|
||||||
merchant: { isSendOnlyCountry },
|
merchant: { isSendOnlyCountry },
|
||||||
} = CommonHooks.useMerchantInfo();
|
} = CommonHooks.useMerchantInfo();
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import SpinnerOverlay from '../../../ReusableComponents/SpinnerOverlay';
|
||||||
|
|
||||||
const TabOverview = () => {
|
const TabOverview = () => {
|
||||||
const { isReady: areTodosReady } = TodosHooks.useTodos();
|
const { isReady: areTodosReady } = TodosHooks.useTodos();
|
||||||
const { isReady: merchantIsReady } = CommonHooks.useMerchantInfo();
|
const { isReady: merchantIsReady } = CommonHooks.useStore();
|
||||||
|
|
||||||
if ( ! areTodosReady || ! merchantIsReady ) {
|
if ( ! areTodosReady || ! merchantIsReady ) {
|
||||||
return <SpinnerOverlay asModal={ true } />;
|
return <SpinnerOverlay asModal={ true } />;
|
||||||
|
|
|
@ -50,7 +50,6 @@ const useHooks = () => {
|
||||||
} = dispatch;
|
} = dispatch;
|
||||||
|
|
||||||
// Transient accessors.
|
// Transient accessors.
|
||||||
const [ isReady ] = useTransient( 'isReady' );
|
|
||||||
const [ activeModal, setActiveModal ] = useTransient( 'activeModal' );
|
const [ activeModal, setActiveModal ] = useTransient( 'activeModal' );
|
||||||
const [ activeHighlight, setActiveHighlight ] =
|
const [ activeHighlight, setActiveHighlight ] =
|
||||||
useTransient( 'activeHighlight' );
|
useTransient( 'activeHighlight' );
|
||||||
|
@ -72,7 +71,6 @@ const useHooks = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isReady,
|
|
||||||
activeModal,
|
activeModal,
|
||||||
setActiveModal,
|
setActiveModal,
|
||||||
activeHighlight,
|
activeHighlight,
|
||||||
|
@ -162,7 +160,7 @@ export const useWebhooks = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useMerchantInfo = () => {
|
export const useMerchantInfo = () => {
|
||||||
const { isReady, features } = useHooks();
|
const { features } = useHooks();
|
||||||
const merchant = useMerchant();
|
const merchant = useMerchant();
|
||||||
const { refreshMerchantData, setMerchant } = useDispatch( STORE_NAME );
|
const { refreshMerchantData, setMerchant } = useDispatch( STORE_NAME );
|
||||||
|
|
||||||
|
@ -187,7 +185,6 @@ export const useMerchantInfo = () => {
|
||||||
}, [ refreshMerchantData, setMerchant ] );
|
}, [ refreshMerchantData, setMerchant ] );
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isReady,
|
|
||||||
merchant, // Merchant details
|
merchant, // Merchant details
|
||||||
features, // Eligible merchant features
|
features, // Eligible merchant features
|
||||||
verifyLoginStatus, // Callback
|
verifyLoginStatus, // Callback
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue