Skip to content

Commit

Permalink
Revert post author changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsilverstein committed Jan 31, 2025
1 parent dea1a89 commit bcf4638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions packages/editor/src/components/post-author/combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -52,7 +51,6 @@ export default function PostAuthorCombobox() {
onChange={ handleSelect }
allowReset={ false }
hideLabelFromVision
isLoading={ isLoading }
/>
);
}
7 changes: 3 additions & 4 deletions packages/editor/src/components/post-author/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand All @@ -30,7 +30,6 @@ export function useAuthorsQuery( search ) {
authorId: _authorId,
authors: getUsers( query ),
postAuthor: getUser( _authorId, BASE_QUERY ),
isLoading: isResolving( 'getUsers', [ query ] ),
};
},
[ search ]
Expand Down Expand Up @@ -69,5 +68,5 @@ export function useAuthorsQuery( search ) {
return [ ...currentAuthor, ...fetchedAuthors ];
}, [ authors, postAuthor ] );

return { authorId, authorOptions, postAuthor, isLoading };
return { authorId, authorOptions, postAuthor };
}

0 comments on commit bcf4638

Please sign in to comment.