Skip to content

Commit

Permalink
Inserter: Patterns: remove loading indicator (#67072)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored Dec 2, 2024
1 parent 2f670d5 commit 358fb8e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
*/
import { useState } from '@wordpress/element';
import { useViewportMatch } from '@wordpress/compose';
import { Button, Spinner } from '@wordpress/components';
import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { useSelect } from '@wordpress/data';

/**
* Internal dependencies
Expand All @@ -16,8 +15,6 @@ import { PatternCategoryPreviews } from './pattern-category-previews';
import { usePatternCategories } from './use-pattern-categories';
import CategoryTabs from '../category-tabs';
import InserterNoResults from '../no-results';
import { store as blockEditorStore } from '../../../store';
import { unlock } from '../../../lock-unlock';

function BlockPatternsTab( {
onSelectCategory,
Expand All @@ -31,19 +28,6 @@ function BlockPatternsTab( {
const categories = usePatternCategories( rootClientId );

const isMobile = useViewportMatch( 'medium', '<' );
const isResolvingPatterns = useSelect(
( select ) =>
unlock( select( blockEditorStore ) ).isResolvingPatterns(),
[]
);

if ( isResolvingPatterns ) {
return (
<div className="block-editor-inserter__patterns-loading">
<Spinner />
</div>
);
}

if ( ! categories.length ) {
return <InserterNoResults />;
Expand Down
15 changes: 0 additions & 15 deletions packages/block-editor/src/store/private-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,21 +406,6 @@ export const getAllPatterns = createRegistrySelector( ( select ) =>
}, getAllPatternsDependants( select ) )
);

export const isResolvingPatterns = createRegistrySelector( ( select ) =>
createSelector( ( state ) => {
const blockPatternsSelect = state.settings[ selectBlockPatternsKey ];
const reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];
return (
( blockPatternsSelect
? blockPatternsSelect( select ) === undefined
: false ) ||
( reusableBlocksSelect
? reusableBlocksSelect( select ) === undefined
: false )
);
}, getAllPatternsDependants( select ) )
);

const EMPTY_ARRAY = [];

export const getReusableBlocks = createRegistrySelector(
Expand Down

1 comment on commit 358fb8e

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 358fb8e.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12117038145
📝 Reported issues:

Please sign in to comment.