Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserter: Patterns: remove loading indicator #67072

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
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 @@ -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
Loading