Skip to content

Commit

Permalink
Updated attribute name and swapped to using coalesce operator
Browse files Browse the repository at this point in the history
  • Loading branch information
pablinos committed Feb 20, 2020
1 parent 95af514 commit 72dd904
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const addPreviewAttribute = block => {
...block,
attributes: {
...block.attributes,
isBlockPreview: true,
__isBlockPreview: true,
},
};
};
Expand Down
3 changes: 1 addition & 2 deletions extensions/shared/wrap-paid-block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { Fragment } from '@wordpress/element';
import { createHigherOrderComponent } from '@wordpress/compose';
import { get } from 'lodash';

/**
* Internal dependencies
Expand All @@ -15,7 +14,7 @@ export default ( { requiredPlan } ) =>
WrappedComponent => props => (
// Wraps the input component in a container, without mutating it. Good!
<Fragment>
{ ! get( props, 'attributes.isBlockPreview', false ) && (
{ ( ! props?.attributes?.__isBlockPreview ?? false ) && (
<UpgradeNudge plan={ requiredPlan } blockName={ props.name } />
) }
<WrappedComponent { ...props } />
Expand Down

0 comments on commit 72dd904

Please sign in to comment.