Skip to content

Commit e25ab36

Browse files
committed
Add comments
1 parent 7a1c408 commit e25ab36

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/containers/gui.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class GUI extends React.Component {
5050

5151
const getFontPromises = () => {
5252
const fontPromises = [];
53+
// Browsers that support the font loader interface have an iterable document.fonts.values()
54+
// Firefox has a mocked out object that doesn't actually implement iterable, which is why
55+
// the deep safety check is necessary.
5356
if (document.fonts &&
5457
typeof document.fonts.values === 'function' &&
5558
typeof document.fonts.values()[Symbol.iterator] === 'function') {
@@ -61,6 +64,8 @@ class GUI extends React.Component {
6164
return fontPromises;
6265
};
6366

67+
// Font promises must be gathered after the document is loaded, because on Mac Chrome, the promise
68+
// objects get replaced and the old ones never resolve.
6469
if (document.readyState === 'complete') {
6570
Promise.all(getFontPromises()).then(this.loadProject);
6671
} else {

0 commit comments

Comments
 (0)