fix: no more intensive error
This commit is contained in:
@@ -20,7 +20,11 @@ export const downloadGoogleFont = async (font: string): Promise<void> => {
|
|||||||
document.head.appendChild(link)
|
document.head.appendChild(link)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
await new FontFaceObserver(font).load()
|
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")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user