From 3632b6b35187696ccd15c0a28ce76a1451db6c68 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Mon, 31 Jan 2022 01:05:06 +0000 Subject: [PATCH] fix(theme): better still just, handle it optionally --- src/context/Theme.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/context/Theme.tsx b/src/context/Theme.tsx index 42383cad..5062667f 100644 --- a/src/context/Theme.tsx +++ b/src/context/Theme.tsx @@ -331,7 +331,7 @@ export default observer(() => { const font = theme.getFont() ?? DEFAULT_FONT; root.setProperty("--font", `"${font}"`); try { - FONTS[font].load(); + FONTS[font]?.load(); } catch (err) { console.error(`Failed to load font: ${font}`); } @@ -341,7 +341,7 @@ export default observer(() => { const font = theme.getMonospaceFont() ?? DEFAULT_MONO_FONT; root.setProperty("--monospace-font", `"${font}"`); try { - MONOSPACE_FONTS[font].load(); + MONOSPACE_FONTS[font]?.load(); } catch (err) { console.error(`Failed to load monospace font: ${font}`); }