Skip to content

Commit

Permalink
Add optional chains
Browse files Browse the repository at this point in the history
  • Loading branch information
malithsen committed Dec 15, 2023
1 parent b85428d commit b608537
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/checkout/woopay/email-input-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export const handleWooPayEmailInput = async (
urlParams.append( 'is_blocks', isBlocksCheckout ? 'true' : 'false' );
urlParams.append(
'source_url',
wcSettings.storePages.checkout.permalink
wcSettings?.storePages?.checkout?.permalink
);
urlParams.append(
'viewport',
Expand Down
6 changes: 4 additions & 2 deletions client/components/woopay/save-user/checkout-page-save-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => {
: {
save_user_in_woopay: isSaveDetailsChecked,
woopay_source_url:
wcSettings.storePages.checkout.permalink,
wcSettings?.storePages?.checkout?.permalink,
woopay_is_blocks: true,
woopay_viewport: `${ viewportWidth }x${ viewportHeight }`,
woopay_user_phone_field: {
Expand Down Expand Up @@ -292,7 +292,9 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => {
<input
type="hidden"
name="woopay_source_url"
value={ wcSettings.storePages.checkout.permalink }
value={
wcSettings?.storePages?.checkout?.permalink
}
/>
<input
type="hidden"
Expand Down

0 comments on commit b608537

Please sign in to comment.