Ignore fontsLoaded/SET_FONTS_LOADED in reduxEvents

This commit is contained in:
Thomas Weber committed 2021-05-08 13:03:28 -05:00
1 parent 8c41345a1c
commit 162e07cfe0
1 file changed
+4 -1
+4 -1
View File
@@ -200,7 +200,10 @@ class Tab extends EventTargetShim {
if (reduxEvents) {
let reduxEventSatisifed = false;
reduxListener = ({detail}) => {
if (reduxEvents.includes(detail.action.type)) {
const type = detail.action.type;
// As addons can't run before DOM exists here, ignore fontsLoaded/SET_FONTS_LOADED
// Otherwise, as our font loading is very async, we could activate more often than required.
if (reduxEvents.includes(type) && type !== 'fontsLoaded/SET_FONTS_LOADED') {
reduxEventSatisifed = true;
}
};