diff --git a/package.json b/package.json index 89826189..49d55823 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.34.0", + "version": "4.34.1", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/sites/twitch-twilight/modules/chat/input.jsx b/src/sites/twitch-twilight/modules/chat/input.jsx index 4a8114e8..7cb95b04 100644 --- a/src/sites/twitch-twilight/modules/chat/input.jsx +++ b/src/sites/twitch-twilight/modules/chat/input.jsx @@ -219,7 +219,7 @@ export default class Input extends Module { try { const above = t.chat.context.get('chat.actions.room-above'), state = t.chat.context.get('context.chat_state') || {}, - container = above ? out : findReactFragment(out, n => n.props && n.props.className === 'chat-input__buttons-container'); + container = above ? findReactFragment(out, n => n.props && Array.isArray(n.props.children)) : findReactFragment(out, n => n.props && n.props.className === 'chat-input__buttons-container'); if ( ! container || ! container.props || ! container.props.children ) return out; diff --git a/src/sites/twitch-twilight/modules/layout.js b/src/sites/twitch-twilight/modules/layout.js index 614633ed..79eade88 100644 --- a/src/sites/twitch-twilight/modules/layout.js +++ b/src/sites/twitch-twilight/modules/layout.js @@ -362,7 +362,7 @@ export default class Layout extends Module { let should_hide = false; if ( game && blocked_games.includes(game) ) should_hide = true; - if ( props.isPromoted && this.settings.get('directory.hide-promoted') ) + if ( props?.isPromoted && this.settings.get('directory.hide-promoted') ) should_hide = true; else { const regexes = this.settings.get('__filter:directory.block-titles'); diff --git a/src/utilities/dom.js b/src/utilities/dom.js index b90bb735..86712a74 100644 --- a/src/utilities/dom.js +++ b/src/utilities/dom.js @@ -58,23 +58,30 @@ export function findReactFragment(frag, criteria, depth = 25, current = 0, visit visited.add(frag); - if ( frag && frag.props && Array.isArray(frag.props.children) ) - for(const child of frag.props.children) { - if ( ! child ) - continue; + if ( frag && frag.props && frag.props.children ) { + if ( Array.isArray(frag.props.children) ) { + for(const child of frag.props.children) { + if ( ! child ) + continue; - if ( Array.isArray(child) ) { - for(const f of child) { - const out = findReactFragment(f, criteria, depth, current + 1, visited); + if ( Array.isArray(child) ) { + for(const f of child) { + const out = findReactFragment(f, criteria, depth, current + 1, visited); + if ( out ) + return out; + } + } else { + const out = findReactFragment(child, criteria, depth, current + 1, visited); if ( out ) return out; } - } else { - const out = findReactFragment(child, criteria, depth, current + 1, visited); - if ( out ) - return out; } + } else { + const out = findReactFragment(frag.props.children, criteria, depth, current + 1, visited); + if ( out ) + return out; } + } return null; }