Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix the issue of select all toggle for fonts without font faces
  • Loading branch information
akasunil committed Jul 22, 2024
commit f3681cbb08f8d631c1ee1a33b7698649b2762f46
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,16 @@ function InstalledFonts() {
).length
: 0;

const selectedFontsCount =
libraryFontSelected?.fontFace?.length ??
( libraryFontSelected?.fontFamily ? 1 : 0 );

// Check if any fonts are selected.
const isIndeterminate =
activeFontsCount > 0 &&
activeFontsCount !== libraryFontSelected?.fontFace?.length;
activeFontsCount > 0 && activeFontsCount !== selectedFontsCount;

// Check if all fonts are selected.
const isSelectAllChecked =
activeFontsCount === libraryFontSelected?.fontFace?.length;
const isSelectAllChecked = activeFontsCount === selectedFontsCount;

// Toggle select all fonts.
const toggleSelectAll = () => {
Expand Down