diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-12-02 12:11:55 -0500 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-12-02 12:11:55 -0500 |
commit | 13e55cd8ec006ab1fa0adbc50bd1ef5294b3a5eb (patch) | |
tree | 78e064da7b8dcc6caccda76cb0f1aec91d95abeb /web | |
parent | 2b7ce16ea906e76211da3500fe134397f57caefe (diff) | |
download | chat-13e55cd8ec006ab1fa0adbc50bd1ef5294b3a5eb.tar.gz chat-13e55cd8ec006ab1fa0adbc50bd1ef5294b3a5eb.tar.bz2 chat-13e55cd8ec006ab1fa0adbc50bd1ef5294b3a5eb.zip |
Stop firefox from crashing due to fonts
Diffstat (limited to 'web')
-rw-r--r-- | web/react/utils/utils.jsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 9f80f1bb8..d2dd6cf38 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -696,8 +696,10 @@ export function applyTheme(theme) { export function applyFont(fontName) { const body = document.querySelector('body'); - body.classList.forEach((className) => { - if (className.lastIndexOf('font') === 0) { + const keys = Object.getOwnPropertyNames(body.classList); + keys.forEach((k) => { + const className = body.classList[k]; + if (className && className.lastIndexOf('font') === 0) { body.classList.remove(className); } }); |