mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-25 12:08:30 +00:00
4.18.7
* Fixed: Clicking emotes in the FFZ Emote Menu. (Broken by a Twitch update.)
This commit is contained in:
parent
aedfcecc14
commit
40cae9f115
6 changed files with 57 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "frankerfacez",
|
||||
"author": "Dan Salvato LLC",
|
||||
"version": "4.18.6",
|
||||
"version": "4.18.7",
|
||||
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
|
|
|
@ -645,7 +645,7 @@ export default class Badges extends Module {
|
|||
async loadGlobalBadges(tries = 0) {
|
||||
let response, data;
|
||||
|
||||
if ( this.experiments.getAssignment('api_load') )
|
||||
if ( this.experiments.getAssignment('api_load') && tries < 1 )
|
||||
try {
|
||||
fetch(`${NEW_API}/v1/badges`).catch(() => {});
|
||||
} catch(err) { /* do nothing */ }
|
||||
|
|
|
@ -542,7 +542,7 @@ export default class Emotes extends Module {
|
|||
async loadGlobalSets(tries = 0) {
|
||||
let response, data;
|
||||
|
||||
if ( this.experiments.getAssignment('api_load') )
|
||||
if ( this.experiments.getAssignment('api_load') && tries < 1 )
|
||||
try {
|
||||
fetch(`${NEW_API}/v1/set/global`).catch(() => {});
|
||||
} catch(err) { /* do nothing */ }
|
||||
|
|
|
@ -188,7 +188,8 @@ Twilight.KNOWN_MODULES = {
|
|||
'chat-types': n => n.b && has(n.b, 'Message') && has(n.b, 'RoomMods'),
|
||||
'gql-printer': n => n !== window && n.print,
|
||||
mousetrap: n => n.bindGlobal && n.unbind && n.handleKey,
|
||||
'algolia-search': n => n.a && n.a.prototype && n.a.prototype.queryTopResults && n.a.prototype.queryForType
|
||||
'algolia-search': n => n.a && n.a.prototype && n.a.prototype.queryTopResults && n.a.prototype.queryForType,
|
||||
highlightstack: n => n.b && has(n.b, '_calculateChangedBits') && n.c && has(n.c, '_calculateChangedBits')
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -316,7 +316,7 @@ export default class EmoteMenu extends Module {
|
|||
channel_id={this.props.channelOwnerID}
|
||||
loading={this.state.gqlLoading}
|
||||
error={this.state.gqlError}
|
||||
onClickEmote={this.props.onClickEmote}
|
||||
onClickToken={this.props.onClickToken}
|
||||
/>
|
||||
</t.MenuErrorWrapper>)
|
||||
}
|
||||
|
@ -520,7 +520,7 @@ export default class EmoteMenu extends Module {
|
|||
if ( t.emotes.handleClick(event) )
|
||||
return;
|
||||
|
||||
this.props.onClickEmote(event.currentTarget.dataset.name)
|
||||
this.props.onClickToken(event.currentTarget.dataset.name)
|
||||
}
|
||||
|
||||
clickHeading() {
|
||||
|
@ -1835,7 +1835,7 @@ export default class EmoteMenu extends Module {
|
|||
key: data.key,
|
||||
data,
|
||||
filtered: this.state.filtered,
|
||||
onClickEmote: this.props.onClickEmote,
|
||||
onClickToken: this.props.onClickToken,
|
||||
startObserving: this.startObserving,
|
||||
stopObserving: this.stopObserving
|
||||
}
|
||||
|
|
|
@ -621,7 +621,9 @@ export default class ChatHook extends Module {
|
|||
|
||||
onEnable() {
|
||||
this.on('site.web_munch:loaded', this.grabTypes);
|
||||
this.on('site.web_munch:loaded', this.defineClasses);
|
||||
this.grabTypes();
|
||||
this.defineClasses();
|
||||
|
||||
this.chat.context.on('changed:chat.points.show-callouts', () => {
|
||||
this.InlineCallout.forceUpdate();
|
||||
|
@ -974,8 +976,29 @@ export default class ChatHook extends Module {
|
|||
|
||||
this.ChatContainer.ready((cls, instances) => {
|
||||
const t = this,
|
||||
old_render = cls.prototype.render,
|
||||
old_catch = cls.prototype.componentDidCatch;
|
||||
|
||||
cls.prototype.render = function() {
|
||||
//try {
|
||||
if ( t.CommunityStackHandler ) {
|
||||
const React = t.web_munch.getModule('react'),
|
||||
out = old_render.call(this),
|
||||
thing = out?.props?.children?.props?.children;
|
||||
|
||||
if ( React && Array.isArray(thing) )
|
||||
thing.push(React.createElement(t.CommunityStackHandler));
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/*} catch(err) {
|
||||
// No op
|
||||
}*/
|
||||
|
||||
return old_render.call(this);
|
||||
}
|
||||
|
||||
// Try catching errors. With any luck, maybe we can
|
||||
// recover from the error when we re-build?
|
||||
cls.prototype.componentDidCatch = function(err, info) {
|
||||
|
@ -1006,6 +1029,32 @@ export default class ChatHook extends Module {
|
|||
}
|
||||
|
||||
|
||||
defineClasses() {
|
||||
if ( this.CommunityStackHandler )
|
||||
return true;
|
||||
|
||||
const t = this,
|
||||
React = this.web_munch.getModule('react'),
|
||||
Stack = this.web_munch.getModule('highlightstack'),
|
||||
createElement = React && React.createElement;
|
||||
|
||||
if ( ! createElement || ! Stack || ! Stack.b )
|
||||
return false;
|
||||
|
||||
this.CommunityStackHandler = function() {
|
||||
const stack = React.useContext(Stack.b),
|
||||
dispatch = React.useContext(Stack.c);
|
||||
|
||||
t.community_stack = stack;
|
||||
t.community_dispatch = dispatch;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
this.ChatContainer.forceUpdate();
|
||||
}
|
||||
|
||||
|
||||
updatePinnedCallouts() {
|
||||
for(const inst of this.PinnedCallout.instances)
|
||||
this.onPinnedCallout(inst);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue