mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +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 { isReady: onboardingIsReady, completed: onboardingCompleted } =
|
||||
OnboardingHooks.useSteps();
|
||||
const { isReady: merchantIsReady } = CommonHooks.useStore();
|
||||
const {
|
||||
isReady: merchantIsReady,
|
||||
merchant: { isSendOnlyCountry },
|
||||
} = CommonHooks.useMerchantInfo();
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import SpinnerOverlay from '../../../ReusableComponents/SpinnerOverlay';
|
|||
|
||||
const TabOverview = () => {
|
||||
const { isReady: areTodosReady } = TodosHooks.useTodos();
|
||||
const { isReady: merchantIsReady } = CommonHooks.useMerchantInfo();
|
||||
const { isReady: merchantIsReady } = CommonHooks.useStore();
|
||||
|
||||
if ( ! areTodosReady || ! merchantIsReady ) {
|
||||
return <SpinnerOverlay asModal={ true } />;
|
||||
|
|
|
@ -50,7 +50,6 @@ const useHooks = () => {
|
|||
} = dispatch;
|
||||
|
||||
// Transient accessors.
|
||||
const [ isReady ] = useTransient( 'isReady' );
|
||||
const [ activeModal, setActiveModal ] = useTransient( 'activeModal' );
|
||||
const [ activeHighlight, setActiveHighlight ] =
|
||||
useTransient( 'activeHighlight' );
|
||||
|
@ -72,7 +71,6 @@ const useHooks = () => {
|
|||
};
|
||||
|
||||
return {
|
||||
isReady,
|
||||
activeModal,
|
||||
setActiveModal,
|
||||
activeHighlight,
|
||||
|
@ -162,7 +160,7 @@ export const useWebhooks = () => {
|
|||
};
|
||||
|
||||
export const useMerchantInfo = () => {
|
||||
const { isReady, features } = useHooks();
|
||||
const { features } = useHooks();
|
||||
const merchant = useMerchant();
|
||||
const { refreshMerchantData, setMerchant } = useDispatch( STORE_NAME );
|
||||
|
||||
|
@ -187,7 +185,6 @@ export const useMerchantInfo = () => {
|
|||
}, [ refreshMerchantData, setMerchant ] );
|
||||
|
||||
return {
|
||||
isReady,
|
||||
merchant, // Merchant details
|
||||
features, // Eligible merchant features
|
||||
verifyLoginStatus, // Callback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue