1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-17 11:30:54 +00:00
Changed: Chat Room Actions now render beneath the chat input, next to the chat settings button.
Fixed: The setting to hide `Latest Videos` from the Following directory breaking many parts of the website.
Fixed: Due to the relocated Chat Room Actions, compatibility is improved with certain features of the BetterTTV browser extension.
This commit is contained in:
SirStendec 2019-08-13 15:58:01 -04:00
parent ae06d67e9f
commit fe300125c7
4 changed files with 43 additions and 14 deletions

View file

@ -40,6 +40,42 @@ export function off(obj, ...args) {
}
export function findReactFragment(frag, criteria, depth = 25, current = 0, visited = null) {
if ( ! visited )
visited = new Set;
else if ( visited.has(frag) )
return null;
if ( criteria(frag) )
return frag;
if ( current >= depth )
return null;
visited.add(frag);
if ( frag && frag.props && 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 ( out )
return out;
}
} else {
const out = findReactFragment(child, criteria, depth, current + 1, visited);
if ( out )
return out;
}
}
return null;
}
export function createElement(tag, props, ...children) {
const el = document.createElement(tag);