Skip to content

Commit

Permalink
Media Store: Update call to is inserter opened
Browse files Browse the repository at this point in the history
  • Loading branch information
renatoagds committed May 2, 2024
1 parent cf5ceed commit a36fd02
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,12 @@ const isInserterOpened = (): boolean => {
// Prior to WP 6.5, the isInserterOpened selector was available in core/edit-post.
// In WP 6.5, it was moved to core/editor. This check is to support both versions of WordPress.
// @to-do: remove exception when Jetpack requires WordPress 6.5.
/* eslint-disable @typescript-eslint/no-explicit-any */
const editorIsInserterOpened = ( select( 'core/editor' ) as any )?.isInserterOpened?.()
? ( select( 'core/editor' ) as any )?.isInserterOpened?.()
: select( 'core/edit-post' )?.isInserterOpened();
/* eslint-enable @typescript-eslint/no-explicit-any */
const selectIsInserterOpened =
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
( select( 'core/editor' ) as any )?.isInserterOpened ??
select( 'core/edit-post' )?.isInserterOpened;

const editorIsInserterOpened = selectIsInserterOpened?.();

return (
editorIsInserterOpened ||
Expand Down

0 comments on commit a36fd02

Please sign in to comment.