Check for enabled methods before payment task completion (https://github.com/woocommerce/woocommerce-admin/pull/4530)

This commit is contained in:
Joshua T Flowers 2020-06-15 08:43:22 +03:00 committed by GitHub
parent fea332b5b4
commit 6baebd1e11
1 changed files with 3 additions and 3 deletions

View File

@ -239,8 +239,8 @@ class Payments extends Component {
const currentMethod = this.getCurrentMethod();
const { busyMethod, enabledMethods, recommendedMethod } = this.state;
const { methods, query, requesting } = this.props;
const configuredMethods = methods.filter(
( method ) => method.isConfigured
const hasEnabledMethods = Object.keys( enabledMethods ).filter(
( method ) => enabledMethods[ method ]
).length;
if ( currentMethod ) {
@ -348,7 +348,7 @@ class Payments extends Component {
);
} ) }
<div className="woocommerce-task-payments__actions">
{ configuredMethods.length === 0 ? (
{ ! hasEnabledMethods ? (
<Button isLink onClick={ this.skipTask }>
{ __(
'My store doesnt take payments',