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:
Philipp Stracker 2025-01-10 19:15:02 +01:00
parent 0735cae04f
commit 54e2258d62
No known key found for this signature in database
2 changed files with 14 additions and 5 deletions

View file

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