From 1e210b0113652a61650d28423218232440613b36 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 6 Feb 2024 13:41:10 +0400 Subject: [PATCH 1/2] Editor: Don't hide authors' Combobox if the current author is missing --- packages/editor/src/components/post-author/combobox.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/editor/src/components/post-author/combobox.js b/packages/editor/src/components/post-author/combobox.js index a2f4c312dfd8a1..cd452761d3ebbc 100644 --- a/packages/editor/src/components/post-author/combobox.js +++ b/packages/editor/src/components/post-author/combobox.js @@ -89,10 +89,6 @@ function PostAuthorCombobox() { setFieldValue( inputValue ); }; - if ( ! postAuthor ) { - return null; - } - return ( Date: Tue, 6 Feb 2024 13:50:35 +0400 Subject: [PATCH 2/2] Remove isLoading state --- packages/editor/src/components/post-author/combobox.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/editor/src/components/post-author/combobox.js b/packages/editor/src/components/post-author/combobox.js index cd452761d3ebbc..aee01ee5178728 100644 --- a/packages/editor/src/components/post-author/combobox.js +++ b/packages/editor/src/components/post-author/combobox.js @@ -18,9 +18,9 @@ import { AUTHORS_QUERY } from './constants'; function PostAuthorCombobox() { const [ fieldValue, setFieldValue ] = useState(); - const { authorId, isLoading, authors, postAuthor } = useSelect( + const { authorId, authors, postAuthor } = useSelect( ( select ) => { - const { getUser, getUsers, isResolving } = select( coreStore ); + const { getUser, getUsers } = select( coreStore ); const { getEditedPostAttribute } = select( editorStore ); const author = getUser( getEditedPostAttribute( 'author' ), { context: 'view', @@ -35,7 +35,6 @@ function PostAuthorCombobox() { authorId: getEditedPostAttribute( 'author' ), postAuthor: author, authors: getUsers( query ), - isLoading: isResolving( 'core', 'getUsers', [ query ] ), }; }, [ fieldValue ] @@ -98,7 +97,6 @@ function PostAuthorCombobox() { value={ authorId } onFilterValueChange={ debounce( handleKeydown, 300 ) } onChange={ handleSelect } - isLoading={ isLoading } allowReset={ false } /> );