Skip to content

Commit

Permalink
Editor: Don't hide authors' Combobox if the current author is missing (
Browse files Browse the repository at this point in the history
…#58719)

* Editor: Don't hide authors' Combobox if the current author is missing
* Remove the isLoading state

Unlinked contributors: dannyreaktiv.

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
  • Loading branch information
3 people authored Feb 7, 2024
1 parent e600d3d commit 3657ee1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/editor/src/components/post-author/combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -35,7 +35,6 @@ function PostAuthorCombobox() {
authorId: getEditedPostAttribute( 'author' ),
postAuthor: author,
authors: getUsers( query ),
isLoading: isResolving( 'core', 'getUsers', [ query ] ),
};
},
[ fieldValue ]
Expand Down Expand Up @@ -89,10 +88,6 @@ function PostAuthorCombobox() {
setFieldValue( inputValue );
};

if ( ! postAuthor ) {
return null;
}

return (
<ComboboxControl
__nextHasNoMarginBottom
Expand All @@ -102,7 +97,6 @@ function PostAuthorCombobox() {
value={ authorId }
onFilterValueChange={ debounce( handleKeydown, 300 ) }
onChange={ handleSelect }
isLoading={ isLoading }
allowReset={ false }
/>
);
Expand Down

0 comments on commit 3657ee1

Please sign in to comment.