mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Settings UI: Fix merchant features state retrieval in hooks
This commit is contained in:
parent
ab3cca33ec
commit
b902d2eea2
3 changed files with 8 additions and 1 deletions
|
@ -21,7 +21,7 @@ import {
|
||||||
const TabOverview = () => {
|
const TabOverview = () => {
|
||||||
const [ isRefreshing, setIsRefreshing ] = useState( false );
|
const [ isRefreshing, setIsRefreshing ] = useState( false );
|
||||||
|
|
||||||
const { merchant, merchantFeatures } = useMerchantInfo();
|
const { merchant, features: merchantFeatures } = useMerchantInfo();
|
||||||
const { refreshFeatureStatuses, setActiveModal } =
|
const { refreshFeatureStatuses, setActiveModal } =
|
||||||
useDispatch( STORE_NAME );
|
useDispatch( STORE_NAME );
|
||||||
const { createSuccessNotice, createErrorNotice } =
|
const { createSuccessNotice, createErrorNotice } =
|
||||||
|
|
|
@ -133,6 +133,7 @@ export const useWebhooks = () => {
|
||||||
checkWebhookSimulationState,
|
checkWebhookSimulationState,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useMerchantInfo = () => {
|
export const useMerchantInfo = () => {
|
||||||
const { isReady, merchant, features } = useHooks();
|
const { isReady, merchant, features } = useHooks();
|
||||||
const { refreshMerchantData } = useDispatch( STORE_NAME );
|
const { refreshMerchantData } = useDispatch( STORE_NAME );
|
||||||
|
|
|
@ -45,6 +45,12 @@ const defaultTransient = Object.freeze( {
|
||||||
google_pay: {
|
google_pay: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
},
|
},
|
||||||
|
alternative_payment_methods: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
pay_later_messaging: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
} ),
|
} ),
|
||||||
|
|
||||||
webhooks: Object.freeze( [] ),
|
webhooks: Object.freeze( [] ),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue