From 38126dcc27bdeba0c6c79bc72501a7bf06fbecf2 Mon Sep 17 00:00:00 2001
From: Philipp Stracker
Date: Wed, 19 Feb 2025 17:38:44 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20invalid=20navigation=20but?=
=?UTF-8?q?ton=20states?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../js/Components/Screens/Onboarding/Steps/StepBusiness.js | 5 +++++
.../js/Components/Screens/Onboarding/Steps/index.js | 3 +--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/StepBusiness.js b/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/StepBusiness.js
index 580ff475c..4154e8baa 100644
--- a/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/StepBusiness.js
+++ b/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/StepBusiness.js
@@ -22,8 +22,13 @@ const StepBusiness = ( {} ) => {
);
useEffect( () => {
+ if ( ! businessChoice ) {
+ return;
+ }
+
setIsCasualSeller( BUSINESS_TYPES.CASUAL_SELLER === businessChoice );
}, [ businessChoice, setIsCasualSeller ] );
+
const { canUseSubscriptions } = OnboardingHooks.useFlags();
const businessChoices = [
{
diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/index.js b/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/index.js
index 2162add6c..ec9330f0a 100644
--- a/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/index.js
+++ b/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/index.js
@@ -36,8 +36,7 @@ const ALL_STEPS = [
id: 'methods',
title: __( 'Choose checkout options', 'woocommerce-paypal-payments' ),
StepComponent: StepPaymentMethods,
- canProceed: ( { methods } ) =>
- methods.areOptionalPaymentMethodsEnabled !== null,
+ canProceed: ( { methods } ) => methods.optionalMethods !== null,
},
{
id: 'complete',