[FIX] im_livechat: font face set not iterable
This commit fixes a traceback that occurs on the frontend on firefox only. The issue is that the `FontFaceSet.values()` return value is considered as non iterable while it is an iterator. This commit solves this issue by using directly `document.fonts` which is considered an iterator even by firefox. closes odoo/odoo#123672 See: https://bugzilla.mozilla.org/show_bug.cgi?id=1780657 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { serverUrl } from "@im_livechat/embed/livechat_data";
|
||||
|
||||
async function loadFontAwesome() {
|
||||
await document.fonts.ready;
|
||||
if ([...document.fonts.values()].some(({ family }) => family === "FontAwesome")) {
|
||||
if ([...document.fonts].some(({ family }) => family === "FontAwesome")) {
|
||||
// FontAwesome already loaded.
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user