mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
✨ Improve the loading experience
Before this change, the settings screen was briefly visible, before the merchant details were loaded from the REST endpoint
This commit is contained in:
parent
0735cae04f
commit
54e2258d62
2 changed files with 14 additions and 5 deletions
|
@ -144,7 +144,7 @@ export const useWebhooks = () => {
|
|||
};
|
||||
};
|
||||
export const useMerchantInfo = () => {
|
||||
const { merchant, features } = useHooks();
|
||||
const { isReady, merchant, features } = useHooks();
|
||||
const { refreshMerchantData } = useDispatch( STORE_NAME );
|
||||
|
||||
const verifyLoginStatus = useCallback( async () => {
|
||||
|
@ -159,6 +159,7 @@ export const useMerchantInfo = () => {
|
|||
}, [ refreshMerchantData, merchant ] );
|
||||
|
||||
return {
|
||||
isReady,
|
||||
merchant, // Merchant details
|
||||
features, // Eligible merchant features
|
||||
verifyLoginStatus, // Callback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue