[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:
tsm-odoo
2023-06-05 16:17:00 +02:00
parent 3db7956b4c
commit 0e30e15ff1
@@ -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;
}