From ecc94e6c3157e1547a9bb47032e328addd2b25d2 Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 22 Jun 2026 14:34:45 -0400 Subject: [PATCH] refactor(fonts): use DEFAULT_FONTS as settings fallback Avoids leaking a pairing's id/label into the stored book fonts. --- src/components/Settings.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 3379e0a..5c855c5 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -6,6 +6,7 @@ import { type BookFonts, type FontRef, BUNDLED_FONTS, + DEFAULT_FONTS, FONT_PAIRINGS, decodeRef, encodeRef, @@ -80,7 +81,7 @@ export function Settings({ onClose, onSave }: { onClose: () => void; onSave: () isbn: book?.metadata.isbn ?? "", language: book?.metadata.language ?? "en", bleed: book?.settings.bleed ?? true, - fonts: book?.settings.fonts ?? FONT_PAIRINGS[0], + fonts: book?.settings.fonts ?? DEFAULT_FONTS, })); const [system, setSystem] = useState(() => systemFontCache ?? []); const [advanced, setAdvanced] = useState(() => pairingFor(draft.fonts) === null);