1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 01:56:55 +00:00
* Fixed: Room actions not rendering due to changes in React internals.
* Fixed: Bug with sidebar cards not being hidden correctly in some situations.
This commit is contained in:
SirStendec 2022-06-11 12:44:54 -04:00
parent bcee12a6b3
commit 4d1d3ae0d2
4 changed files with 21 additions and 14 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "frankerfacez", "name": "frankerfacez",
"author": "Dan Salvato LLC", "author": "Dan Salvato LLC",
"version": "4.34.0", "version": "4.34.1",
"description": "FrankerFaceZ is a Twitch enhancement suite.", "description": "FrankerFaceZ is a Twitch enhancement suite.",
"private": true, "private": true,
"license": "Apache-2.0", "license": "Apache-2.0",

View file

@ -219,7 +219,7 @@ export default class Input extends Module {
try { try {
const above = t.chat.context.get('chat.actions.room-above'), const above = t.chat.context.get('chat.actions.room-above'),
state = t.chat.context.get('context.chat_state') || {}, 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 ) if ( ! container || ! container.props || ! container.props.children )
return out; return out;

View file

@ -362,7 +362,7 @@ export default class Layout extends Module {
let should_hide = false; let should_hide = false;
if ( game && blocked_games.includes(game) ) if ( game && blocked_games.includes(game) )
should_hide = true; should_hide = true;
if ( props.isPromoted && this.settings.get('directory.hide-promoted') ) if ( props?.isPromoted && this.settings.get('directory.hide-promoted') )
should_hide = true; should_hide = true;
else { else {
const regexes = this.settings.get('__filter:directory.block-titles'); const regexes = this.settings.get('__filter:directory.block-titles');

View file

@ -58,7 +58,8 @@ export function findReactFragment(frag, criteria, depth = 25, current = 0, visit
visited.add(frag); visited.add(frag);
if ( frag && frag.props && Array.isArray(frag.props.children) ) if ( frag && frag.props && frag.props.children ) {
if ( Array.isArray(frag.props.children) ) {
for(const child of frag.props.children) { for(const child of frag.props.children) {
if ( ! child ) if ( ! child )
continue; continue;
@ -75,6 +76,12 @@ export function findReactFragment(frag, criteria, depth = 25, current = 0, visit
return out; return out;
} }
} }
} else {
const out = findReactFragment(frag.props.children, criteria, depth, current + 1, visited);
if ( out )
return out;
}
}
return null; return null;
} }