fix(theme): better still just, handle it optionally

This commit is contained in:
Paul Makles 2022-01-31 01:05:06 +00:00
parent edaf2256d5
commit 3632b6b351

View file

@ -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}`);
}