Skip to content

Commit

Permalink
Only show typesets if there are fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Jun 13, 2024
1 parent 77bd6f0 commit b0eef05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function TypesetButton() {
const { user: userConfig } = useContext( GlobalStylesContext );
const config = mergeBaseAndUserConfigs( base, userConfig );
const allFontFamilies = getFontFamilies( config );
const hasFonts = 0 < allFontFamilies.length;
const hasFonts =
allFontFamilies.filter( ( font ) => font !== null ).length > 0;

return (
hasFonts && (
Expand Down
3 changes: 2 additions & 1 deletion packages/edit-site/src/components/global-styles/typeset.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function Typesets() {
const { user: userConfig } = useContext( GlobalStylesContext );
const config = mergeBaseAndUserConfigs( base, userConfig );
const allFontFamilies = getFontFamilies( config );
const hasFonts = 0 < allFontFamilies.length;
const hasFonts =
allFontFamilies.filter( ( font ) => font !== null ).length > 0;

return (
hasFonts && (
Expand Down

0 comments on commit b0eef05

Please sign in to comment.