Skip to content

Commit

Permalink
Patterns: Fix empty general template parts category (#52747)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Glen Davies <[email protected]>
  • Loading branch information
2 people authored and tellthemachines committed Jul 24, 2023
1 parent 4b52967 commit 94995ef
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import usePatterns from './use-patterns';
import SidebarButton from '../sidebar-button';
import useDebouncedInput from '../../utils/use-debounced-input';
import { unlock } from '../../lock-unlock';
import { SYNC_TYPES, USER_PATTERN_CATEGORY } from './utils';
import { SYNC_TYPES, USER_PATTERN_CATEGORY, PATTERNS } from './utils';

const { useLocation, useHistory } = unlock( routerPrivateApis );

Expand Down Expand Up @@ -58,9 +58,12 @@ export default function PatternsList( { categoryId, type } ) {
const [ syncFilter, setSyncFilter ] = useState( 'all' );
const deferredSyncedFilter = useDeferredValue( syncFilter );

const isUncategorizedThemePatterns =
type === PATTERNS && categoryId === 'uncategorized';

const { patterns, isResolving } = usePatterns(
type,
categoryId !== 'uncategorized' ? categoryId : '',
isUncategorizedThemePatterns ? '' : categoryId,
{
search: deferredFilterValue,
syncStatus:
Expand Down

0 comments on commit 94995ef

Please sign in to comment.