frontend: fix fonts loading

This commit is contained in:
fly_mc 2024-11-19 21:54:26 +08:00
parent 966f8197eb
commit 8caf4e33b3

View file

@ -82,6 +82,18 @@ export function getDefaultFontSettings() {
console.log(newFontId);
}
if (fontFace.value !== 'system-ui') {
if (window.requestIdleCallback) {
window.requestIdleCallback(() => {
loadFontStyle(fontFace.value);
});
} else {
setTimeout(() => {
loadFontStyle(fontFace.value);
}, 0);
}
}
watch(fontFace, (newVal) => {
const optionsList = getFontOptionsList(newVal);
if (optionsList.length !== 0) {