Skip to content

Commit

Permalink
Fix parameters to allow for connectAfterCheckout flow from recommenda…
Browse files Browse the repository at this point in the history
…tion card (#39578)

* Fix parameters to allow for connectAfterCheckout flow from recommendation card

* changelog

* Fix fetching the default value in the hook itself

* changelog
  • Loading branch information
robertsreberski authored Sep 30, 2024
1 parent 69d30d9 commit 3c21b1b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Fetch adminUrl current value on function run
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const {
apiNonce,
siteSuffix: defaultSiteSuffix,
} = window?.JP_CONNECTION_INITIAL_STATE || getScriptData()?.connection || {};
const defaultAdminUrl =
const defaultAdminUrl = () =>
typeof window !== 'undefined' ? window?.myJetpackInitialState?.adminUrl : null;

/**
Expand All @@ -38,7 +38,7 @@ export default function useProductCheckoutWorkflow( {
productSlug,
redirectUrl,
siteSuffix = defaultSiteSuffix,
adminUrl = defaultAdminUrl,
adminUrl = defaultAdminUrl(),
connectAfterCheckout = false,
siteProductAvailabilityHandler = null,
quantity = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Fix parameters to allow for connectAfterCheckout flow from recommendation card

0 comments on commit 3c21b1b

Please sign in to comment.