Handle failures
This commit is contained in:
@@ -439,7 +439,7 @@
|
|||||||
InterExtraBoldItalic.load();
|
InterExtraBoldItalic.load();
|
||||||
InterBlack.load();
|
InterBlack.load();
|
||||||
InterBlackItalic.load();
|
InterBlackItalic.load();
|
||||||
} catch () {}
|
} catch (e) {}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% block html_head_extra -%}{%- endblock %}
|
{% block html_head_extra -%}{%- endblock %}
|
||||||
|
|||||||
@@ -4,9 +4,17 @@ export function useFonts() {
|
|||||||
const [loaded, setLoaded] = React.useState(false)
|
const [loaded, setLoaded] = React.useState(false)
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
document.fonts.ready.then(() => {
|
try {
|
||||||
|
document.fonts.ready
|
||||||
|
.then(() => {
|
||||||
|
setLoaded(true)
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setLoaded(true)
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
setLoaded(true)
|
setLoaded(true)
|
||||||
})
|
}
|
||||||
}, [setLoaded])
|
}, [setLoaded])
|
||||||
|
|
||||||
return [loaded, null]
|
return [loaded, null]
|
||||||
|
|||||||
+1
-1
@@ -433,7 +433,7 @@
|
|||||||
InterExtraBoldItalic.load();
|
InterExtraBoldItalic.load();
|
||||||
InterBlack.load();
|
InterBlack.load();
|
||||||
InterBlackItalic.load();
|
InterBlackItalic.load();
|
||||||
} catch () {}
|
} catch (e) {}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user