diff --git a/src/utils/downloadGoogleFont.ts b/src/utils/downloadGoogleFont.ts index 519f0ea..13048cb 100644 --- a/src/utils/downloadGoogleFont.ts +++ b/src/utils/downloadGoogleFont.ts @@ -20,7 +20,11 @@ export const downloadGoogleFont = async (font: string): Promise => { document.head.appendChild(link) } - await new FontFaceObserver(font).load() + try { + await new FontFaceObserver(font).load() - document.documentElement.style.setProperty("--font-family", font) + document.documentElement.style.setProperty("--font-family", font) + } catch (error) { + console.warn("error when loading font") + } }