From 46dd59ef8dfd84edc47f74ca7484a435c43d8db0 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Wed, 28 Oct 2020 17:09:37 -0400 Subject: [PATCH] 4.20.44 * Fixed: Switchboard being unable to force a chunk to load after Twitch made changes to their async component loader. * Changed: Grab the latest chat types array from Twitch. * Changed: Delay forcing a layout update when loading our CSS to ensure it has more of a chance to load and affect the page. --- package.json | 2 +- .../main_menu/components/game-list-editor.vue | 4 ---- .../twitch-twilight/modules/chat/index.js | 3 ++- .../modules/css_tweaks/index.js | 2 ++ .../modules/directory/index.jsx | 19 +++++++++++++++++-- src/sites/twitch-twilight/modules/layout.js | 2 +- src/sites/twitch-twilight/switchboard.js | 2 +- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 76bb0112..de6d5860 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.20.43", + "version": "4.20.44", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/modules/main_menu/components/game-list-editor.vue b/src/modules/main_menu/components/game-list-editor.vue index 1742b75a..cc0eef3f 100644 --- a/src/modules/main_menu/components/game-list-editor.vue +++ b/src/modules/main_menu/components/game-list-editor.vue @@ -146,10 +146,6 @@ export default { return []; return deep_copy(data.items); - }, - - onSelected(...args) { - console.log('selected', args); } } } diff --git a/src/sites/twitch-twilight/modules/chat/index.js b/src/sites/twitch-twilight/modules/chat/index.js index f8c46370..c41d96de 100644 --- a/src/sites/twitch-twilight/modules/chat/index.js +++ b/src/sites/twitch-twilight/modules/chat/index.js @@ -136,7 +136,8 @@ const CHAT_TYPES = make_enum( 'BitsBadgeTierMessage', 'InlinePrivateCallout', 'ChannelPointsReward', - 'CommunityChallengeContribution' + 'CommunityChallengeContribution', + 'CelebrationPurchase' ); diff --git a/src/sites/twitch-twilight/modules/css_tweaks/index.js b/src/sites/twitch-twilight/modules/css_tweaks/index.js index f2fe2c27..37c8bf47 100644 --- a/src/sites/twitch-twilight/modules/css_tweaks/index.js +++ b/src/sites/twitch-twilight/modules/css_tweaks/index.js @@ -522,6 +522,8 @@ export default class CSSTweaks extends Module { this.chunks[k] = raw(key).default; } + this.emit('site.layout:resize'); + this.chunks_loaded = true; r(); }) diff --git a/src/sites/twitch-twilight/modules/directory/index.jsx b/src/sites/twitch-twilight/modules/directory/index.jsx index c3ec8f15..bb64fe9a 100644 --- a/src/sites/twitch-twilight/modules/directory/index.jsx +++ b/src/sites/twitch-twilight/modules/directory/index.jsx @@ -331,12 +331,27 @@ export default class Directory extends SiteModule { if ( ! props?.channelLogin ) return; - const game = props.gameTitle || props.trackingProps?.categoryName || props.trackingProps?.category; + const game = props.gameTitle || props.trackingProps?.categoryName || props.trackingProps?.category, + tags = props.tagListProps?.tags; + + let bad_tag = false; el.classList.toggle('ffz-hide-thumbnail', this.settings.provider.get('directory.game.hidden-thumbnails', []).includes(game)); el.dataset.ffzType = props.streamType; - const should_hide = (props.streamType === 'rerun' && this.settings.get('directory.hide-vodcasts')) || + if ( Array.isArray(tags) ) { + const bad_tags = this.settings.provider.get('directory.game.hidden-tags', []); + if ( bad_tags.length ) { + for(const tag of tags) { + if ( tag?.id && bad_tags.includes(tag.id) ) { + bad_tag = true; + break; + } + } + } + } + + const should_hide = bad_tag || (props.streamType === 'rerun' && this.settings.get('directory.hide-vodcasts')) || (props.context != null && props.context !== CARD_CONTEXTS.SingleGameList && this.settings.provider.get('directory.game.blocked-games', []).includes(game)) || ((props.sourceType === 'PROMOTION' || props.sourceType === 'SPONSORED') && this.settings.get('directory.hide-promoted')); diff --git a/src/sites/twitch-twilight/modules/layout.js b/src/sites/twitch-twilight/modules/layout.js index 04fc80f9..711facc8 100644 --- a/src/sites/twitch-twilight/modules/layout.js +++ b/src/sites/twitch-twilight/modules/layout.js @@ -261,7 +261,7 @@ export default class Layout extends Module { if ( this._resize_timer ) return; - this._resize_timer = requestAnimationFrame(() => this._handleResize()); + this._resize_timer = setTimeout(() => this._handleResize(), 50); } _handleResize() { diff --git a/src/sites/twitch-twilight/switchboard.js b/src/sites/twitch-twilight/switchboard.js index 53d1c139..7e953760 100644 --- a/src/sites/twitch-twilight/switchboard.js +++ b/src/sites/twitch-twilight/switchboard.js @@ -87,7 +87,7 @@ export default class Switchboard extends Module { if ( component_class.Preload ) { try { - component = component_class.Preload(); + component = component_class.Preload({priority: 1}); } catch(err) { this.log.warn('Error instantiating preloader for forced chunk loading.', err); component = null;