Check for enabled methods before payment task completion (https://github.com/woocommerce/woocommerce-admin/pull/4530)
This commit is contained in:
parent
fea332b5b4
commit
6baebd1e11
|
@ -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 doesn’t take payments',
|
'My store doesn’t take payments',
|
||||||
|
|
Loading…
Reference in New Issue