From 936509b4464591d799d3ff0aaf2c4cf1553332af Mon Sep 17 00:00:00 2001 From: David Calhoun <438664+dcalhoun@users.noreply.github.com> Date: Tue, 28 Sep 2021 20:28:08 -0400 Subject: [PATCH] Enable new block badge globally We decided to enable the new block badge for all users. --- .../use-block-type-impressions.native.js | 35 ++++++++----------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/packages/block-editor/src/components/inserter/hooks/use-block-type-impressions.native.js b/packages/block-editor/src/components/inserter/hooks/use-block-type-impressions.native.js index 2fcd6dc1c958d1..6106bdf5dea684 100644 --- a/packages/block-editor/src/components/inserter/hooks/use-block-type-impressions.native.js +++ b/packages/block-editor/src/components/inserter/hooks/use-block-type-impressions.native.js @@ -10,29 +10,22 @@ import { setBlockTypeImpressions } from '@wordpress/react-native-bridge'; import { store as blockEditorStore } from '../../../store'; function useBlockTypeImpressions( blockTypes ) { - const { blockTypeImpressions, enableEditorOnboarding } = useSelect( - ( select ) => { - const { getSettings: getBlockEditorSettings } = select( - blockEditorStore - ); - const { editorOnboarding, impressions } = getBlockEditorSettings(); - - return { - blockTypeImpressions: impressions, - enableEditorOnboarding: editorOnboarding, - }; - }, - [] - ); + const { blockTypeImpressions } = useSelect( ( select ) => { + const { getSettings: getBlockEditorSettings } = select( + blockEditorStore + ); + const { impressions } = getBlockEditorSettings(); + + return { + blockTypeImpressions: impressions, + }; + }, [] ); const { updateSettings } = useDispatch( blockEditorStore ); - const items = enableEditorOnboarding - ? blockTypes.map( ( blockType ) => ( { - ...blockType, - isNew: blockTypeImpressions[ blockType.name ] > 0, - } ) ) - : blockTypes; - + const items = blockTypes.map( ( blockType ) => ( { + ...blockType, + isNew: blockTypeImpressions[ blockType.name ] > 0, + } ) ); const trackBlockTypeSelected = ( { name } ) => { if ( blockTypeImpressions[ name ] > 0 ) { const updatedBlockTypeImpressions = {