Invalidate task status when enabling a payment gateway (https://github.com/woocommerce/woocommerce-admin/pull/7330)
This commit is contained in:
parent
8e61f55017
commit
d14d489a05
|
@ -21,6 +21,9 @@ import { WCPaySuggestion } from './components/WCPay';
|
||||||
import './plugins/Bacs';
|
import './plugins/Bacs';
|
||||||
|
|
||||||
export const PaymentGatewaySuggestions = ( { query } ) => {
|
export const PaymentGatewaySuggestions = ( { query } ) => {
|
||||||
|
const { invalidateResolutionForStoreSelector } = useDispatch(
|
||||||
|
ONBOARDING_STORE_NAME
|
||||||
|
);
|
||||||
const { updatePaymentGateway } = useDispatch( PAYMENT_GATEWAYS_STORE_NAME );
|
const { updatePaymentGateway } = useDispatch( PAYMENT_GATEWAYS_STORE_NAME );
|
||||||
const { getPaymentGateway, paymentGateways, isResolving } = useSelect(
|
const { getPaymentGateway, paymentGateways, isResolving } = useSelect(
|
||||||
( select ) => {
|
( select ) => {
|
||||||
|
@ -95,6 +98,8 @@ export const PaymentGatewaySuggestions = ( { query } ) => {
|
||||||
|
|
||||||
updatePaymentGateway( id, {
|
updatePaymentGateway( id, {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
} ).then( () => {
|
||||||
|
invalidateResolutionForStoreSelector( 'getTasksStatus' );
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue