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