From bcf4638e1fa2257fba5cec7858e102acf24f26f7 Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Fri, 31 Jan 2025 09:32:44 -0700 Subject: [PATCH] Revert post author changes --- packages/editor/src/components/post-author/combobox.js | 4 +--- packages/editor/src/components/post-author/hook.js | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/editor/src/components/post-author/combobox.js b/packages/editor/src/components/post-author/combobox.js index 9cc6e01f5b82ce..867eca7947976a 100644 --- a/packages/editor/src/components/post-author/combobox.js +++ b/packages/editor/src/components/post-author/combobox.js @@ -17,8 +17,7 @@ export default function PostAuthorCombobox() { const [ fieldValue, setFieldValue ] = useState(); const { editPost } = useDispatch( editorStore ); - const { authorId, authorOptions, isLoading } = - useAuthorsQuery( fieldValue ); + const { authorId, authorOptions } = useAuthorsQuery( fieldValue ); /** * Handle author selection. @@ -52,7 +51,6 @@ export default function PostAuthorCombobox() { onChange={ handleSelect } allowReset={ false } hideLabelFromVision - isLoading={ isLoading } /> ); } diff --git a/packages/editor/src/components/post-author/hook.js b/packages/editor/src/components/post-author/hook.js index 28c4c126547b82..f251eba79e1806 100644 --- a/packages/editor/src/components/post-author/hook.js +++ b/packages/editor/src/components/post-author/hook.js @@ -14,9 +14,9 @@ import { store as editorStore } from '../../store'; import { AUTHORS_QUERY, BASE_QUERY } from './constants'; export function useAuthorsQuery( search ) { - const { authorId, authors, postAuthor, isLoading } = useSelect( + const { authorId, authors, postAuthor } = useSelect( ( select ) => { - const { getUser, getUsers, isResolving } = select( coreStore ); + const { getUser, getUsers } = select( coreStore ); const { getEditedPostAttribute } = select( editorStore ); const _authorId = getEditedPostAttribute( 'author' ); const query = { ...AUTHORS_QUERY }; @@ -30,7 +30,6 @@ export function useAuthorsQuery( search ) { authorId: _authorId, authors: getUsers( query ), postAuthor: getUser( _authorId, BASE_QUERY ), - isLoading: isResolving( 'getUsers', [ query ] ), }; }, [ search ] @@ -69,5 +68,5 @@ export function useAuthorsQuery( search ) { return [ ...currentAuthor, ...fetchedAuthors ]; }, [ authors, postAuthor ] ); - return { authorId, authorOptions, postAuthor, isLoading }; + return { authorId, authorOptions, postAuthor }; }