Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const SITE_EDITOR_AUTHORS_QUERY = {
capabilities: [ 'edit_theme_options' ],
};
const DEFAULT_QUERY = { per_page: 100, page: 1 };
const EMPTY_ARRAY: RawRevision[] = [];
const EMPTY_ARRAY: [] = [];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not the best type, but it works and compiles :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's OK, unless we want to have multiple EMPTY_ARRAYs 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, we only want a single stable fallback.


export default function useGlobalStylesRevisions( {
query,
Expand Down Expand Up @@ -96,7 +96,7 @@ export default function useGlobalStylesRevisions( {
: EMPTY_ARRAY;
// @ts-expect-error - getUsers is not fully typed
const _authors: User[] =
getUsers( SITE_EDITOR_AUTHORS_QUERY ) || [];
getUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;
const _isResolving = globalStylesId
? isResolving( 'getRevisions', [
'root',
Expand Down
Loading