Skip to content

Commit

Permalink
fix access to some properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed May 29, 2024
1 parent 548850a commit 23b54b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/editor/src/components/post-actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,8 @@ export const duplicatePatternAction = {
const [ item ] = items;
const isThemePattern = item.type === PATTERN_TYPES.theme;
const duplicatedProps = useDuplicatePatternProps( {
pattern: isThemePattern ? item : item.patternPost,
pattern:
isThemePattern || ! item.patternPost ? item : item.patternPost,
onSuccess: () => closeModal(),
} );
return (
Expand Down Expand Up @@ -1014,7 +1015,7 @@ export const duplicateTemplatePartAction = {
return (
<CreateTemplatePartModalContents
blocks={ item.blocks }
defaultArea={ item.templatePart.area }
defaultArea={ item.templatePart?.area || item.area }
defaultTitle={ sprintf(
/* translators: %s: Existing template part title */
__( '%s (Copy)' ),
Expand Down

0 comments on commit 23b54b4

Please sign in to comment.