From 43fb27f74259b89200e6f438e80154fc0963dddf Mon Sep 17 00:00:00 2001 From: Zebulan Stanphill Date: Thu, 23 Jul 2020 10:41:09 -0500 Subject: [PATCH] One less temporary variable. --- packages/editor/src/components/post-format/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/editor/src/components/post-format/index.js b/packages/editor/src/components/post-format/index.js index d18844815bbf4..f126fb2aa7d09 100644 --- a/packages/editor/src/components/post-format/index.js +++ b/packages/editor/src/components/post-format/index.js @@ -52,16 +52,14 @@ export default function PostFormat() { potentialSuggestedFormat !== _currentFormat && supportedFormats.includes( potentialSuggestedFormat ); - const _suggestedFormat = suggestionIsValid - ? potentialSuggestedFormat - : null; - return { currentFormat: _currentFormat, // The current format may not be supported by the theme. // Ensure it is always shown in the select control. listedFormats: union( [ _currentFormat ], supportedFormats ), - suggestedFormat: _suggestedFormat, + suggestedFormat: suggestionIsValid + ? potentialSuggestedFormat + : null, }; }, []