From 032c8821dfc53d07868b58b03e00c6e4420fa9ab Mon Sep 17 00:00:00 2001 From: SirStendec Date: Fri, 10 Sep 2021 16:53:52 -0400 Subject: [PATCH] 4.29.2 * Fixed: Initialization problems in pop-out chat. * Changed: Set a default size for emoji, to prevent rendering issues in any future cases where initialization breaks. --- package.json | 2 +- src/sites/twitch-twilight/styles/chat.scss | 1 + src/utilities/compat/apollo.js | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 844f3055..3e726317 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.29.1", + "version": "4.29.2", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/sites/twitch-twilight/styles/chat.scss b/src/sites/twitch-twilight/styles/chat.scss index 9cc77047..b6561235 100644 --- a/src/sites/twitch-twilight/styles/chat.scss +++ b/src/sites/twitch-twilight/styles/chat.scss @@ -133,6 +133,7 @@ } .ffz-emoji { + width: 1.8rem; height: 1.8rem; width: calc(var(--ffz-chat-font-size) * 1.5); height: calc(var(--ffz-chat-font-size) * 1.5); diff --git a/src/utilities/compat/apollo.js b/src/utilities/compat/apollo.js index 83d4899c..e4351d53 100644 --- a/src/utilities/compat/apollo.js +++ b/src/utilities/compat/apollo.js @@ -85,11 +85,19 @@ export default class Apollo extends Module { const root = this.fine.react, inst = root && root.stateNode; - client = inst?.props?.client || root?.memoizedProps?.client; + client = inst?.props?.client; if ( root && ! client ) { - client = this.fine.searchTree(null, n => n.props?.client?.queryManager, 500); - if ( client ) - client = client?.props?.client; + let i=0, node = root; + while( ! client?.queryManager && node && i++ < 20 ) { + client = node?.memoizedProps?.client; + node = node?.child; + } + + if ( ! client ) { + const host = this.fine.searchTree(null, n => n.props?.client?.queryManager, 500); + if ( host ) + client = host.props.client; + } } this.client = client;