Invalidate task status when enabling a payment gateway (https://github.com/woocommerce/woocommerce-admin/pull/7330)

This commit is contained in:
Joshua T Flowers 2021-07-14 18:59:43 -04:00 committed by GitHub
parent 8e61f55017
commit d14d489a05
1 changed files with 5 additions and 0 deletions

View File

@ -21,6 +21,9 @@ import { WCPaySuggestion } from './components/WCPay';
import './plugins/Bacs';
export const PaymentGatewaySuggestions = ( { query } ) => {
const { invalidateResolutionForStoreSelector } = useDispatch(
ONBOARDING_STORE_NAME
);
const { updatePaymentGateway } = useDispatch( PAYMENT_GATEWAYS_STORE_NAME );
const { getPaymentGateway, paymentGateways, isResolving } = useSelect(
( select ) => {
@ -95,6 +98,8 @@ export const PaymentGatewaySuggestions = ( { query } ) => {
updatePaymentGateway( id, {
enabled: true,
} ).then( () => {
invalidateResolutionForStoreSelector( 'getTasksStatus' );
} );
};