From 8eca11d68f986251d8d58ffd985b9f93a839d2a4 Mon Sep 17 00:00:00 2001 From: Dylan Munson <65001528+CodeyGuyDylan@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:02:46 -0600 Subject: [PATCH] Check for current user connection instead of connected owner --- projects/plugins/jetpack/extensions/blocks/donations/edit.js | 4 ++-- .../plugins/jetpack/extensions/blocks/payment-buttons/edit.js | 4 ++-- .../plugins/jetpack/extensions/blocks/payments-intro/edit.js | 4 ++-- projects/plugins/jetpack/extensions/blocks/paywall/edit.js | 4 ++-- .../plugins/jetpack/extensions/blocks/premium-content/edit.js | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/projects/plugins/jetpack/extensions/blocks/donations/edit.js b/projects/plugins/jetpack/extensions/blocks/donations/edit.js index f19f29076c8f0..c4bd4b1c24598 100644 --- a/projects/plugins/jetpack/extensions/blocks/donations/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/donations/edit.js @@ -22,7 +22,7 @@ const Edit = props => { const blockProps = useBlockProps(); const [ loadingError, setLoadingError ] = useState( '' ); const [ products, setProducts ] = useState( [] ); - const { hasConnectedOwner } = useConnection(); + const { isUserConnected } = useConnection(); const { lockPostSaving, unlockPostSaving } = useDispatch( 'core/editor' ); const post = useSelect( select => select( 'core/editor' ).getCurrentPost(), [] ); @@ -137,7 +137,7 @@ const Edit = props => { let content; - if ( ! hasConnectedOwner ) { + if ( ! isUserConnected ) { content = ( { const { getConnectUrl, isApiStateConnected } = select( membershipProductsStore ); return { @@ -76,7 +76,7 @@ function PaymentButtonsEdit( { clientId, attributes } ) { delete innerBlocksProps.id; delete innerBlocksProps[ 'data-block' ]; - if ( ! hasConnectedOwner ) { + if ( ! isUserConnected ) { return (
select( editorStore ).getCurrentPostType(), [] ); const accessLevel = useAccessLevel( postType ); - const { hasConnectedOwner } = useConnection(); + const { isUserConnected } = useConnection(); const { stripeConnectUrl, hasTierPlans } = useSelect( select => { const { getNewsletterTierProducts, getConnectUrl } = select( 'jetpack/membership-products' ); @@ -46,7 +46,7 @@ function PaywallEdit() { setAccess( value ); } - if ( ! hasConnectedOwner ) { + if ( ! isUserConnected ) { return (
setAttributes( { selectedPlanIds: productIds } ); @@ -102,7 +102,7 @@ function Edit( { clientId, isSelected, attributes, setAttributes } ) { const isSmallViewport = useViewportMatch( 'medium', '<' ); - if ( ! hasConnectedOwner ) { + if ( ! isUserConnected ) { return (