Skip to content

Commit 5e0437d

Browse files
committed
Refactor: Avoid calling getCurrentPostType twice
1 parent 73b4298 commit 5e0437d

File tree

1 file changed

+3
-2
lines changed
  • packages/editor/src/components/start-page-options

1 file changed

+3
-2
lines changed

packages/editor/src/components/start-page-options/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,13 @@ export default function StartPageOptions() {
151151
'core',
152152
'enableChoosePatternModal'
153153
);
154+
const currentPostType = getCurrentPostType();
154155
return {
155156
postId: getCurrentPostId(),
156157
enabled:
157158
choosePatternModalEnabled &&
158-
TEMPLATE_POST_TYPE !== getCurrentPostType() &&
159-
TEMPLATE_PART_POST_TYPE !== getCurrentPostType(),
159+
TEMPLATE_POST_TYPE !== currentPostType &&
160+
TEMPLATE_PART_POST_TYPE !== currentPostType,
160161
};
161162
}, [] );
162163

0 commit comments

Comments
 (0)