diff --git a/packages/editor/src/components/post-featured-image/index.js b/packages/editor/src/components/post-featured-image/index.js index 46a194f311a5e7..b362416e97454f 100644 --- a/packages/editor/src/components/post-featured-image/index.js +++ b/packages/editor/src/components/post-featured-image/index.js @@ -18,7 +18,7 @@ import { Notice, } from '@wordpress/components'; import { isBlobURL } from '@wordpress/blob'; -import { useState, useRef, useEffect } from '@wordpress/element'; +import { useState, useRef } from '@wordpress/element'; import { compose } from '@wordpress/compose'; import { useSelect, withDispatch, withSelect } from '@wordpress/data'; import { @@ -102,17 +102,10 @@ function PostFeaturedImage( { noticeOperations, isRequestingFeaturedImageMedia, } ) { - const toggleRef = useRef(); + const focusToggleRef = useRef( false ); const [ isLoading, setIsLoading ] = useState( false ); const { getSettings } = useSelect( blockEditorStore ); const { mediaSourceUrl } = getMediaDetails( media, currentPostId ); - const toggleFocusTimerRef = useRef(); - - useEffect( () => { - return () => { - clearTimeout( toggleFocusTimerRef.current ); - }; - }, [] ); function onDropFiles( filesList ) { getSettings().mediaUpload( { @@ -203,7 +196,15 @@ function PostFeaturedImage( { ) : (