♻️ Remove duplicate “common.isReady” accessor

This commit is contained in:
Philipp Stracker 2025-02-17 13:24:12 +01:00
parent 161df3a85f
commit 0867a3cc63
No known key found for this signature in database
3 changed files with 3 additions and 6 deletions

View file

@ -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();

View file

@ -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 } />;

View file

@ -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