1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-10 16:10:55 +00:00
* Added: Setting for customizing how tab-completion matches emote names.
* Added: Clips pages now have support for opening emote cards when clicking an emote in the chat replay.
* Fixed: Issue where chat was not rendering as intended on clips pages.
* Fixed: Issue where the FFZ Control Center link was not added to clips pages.
* Fixed: The chat actions module being instantiated in memory twice.
* Fixed: Blank badges appearing in chat, most notably in historic messages, when a chat message has invalid badge data associated with it.
* Fixed: Use a mutation observer for detecting the drops Claim button, rather than a simple timeout, for better consistency.
* Fixed: Issue when using the webpack public path variable that may lead to URL generation with extra `/` characters, breaking some behavior in Firefox when packaged as a local extension.
* API Added: Support for displaying an emote's original name, if an emote has been given a collection-specific name, using an `original_name` field.
This commit is contained in:
SirStendec 2023-09-09 17:43:51 -04:00
parent fc009a84e7
commit 8ac95f3a52
25 changed files with 654 additions and 52 deletions

View file

@ -1211,7 +1211,7 @@ export default class ChatHook extends Module {
this._ffz_auto_drop = setTimeout(() => {
this._ffz_auto_drop = null;
t.autoClickDrop(this);
}, 250);
}, 0);
} catch(err) {
t.log.capture(err);
@ -1512,19 +1512,40 @@ export default class ChatHook extends Module {
autoClickDrop(inst) {
if ( inst._ffz_clicking )
return;
// Check to ensure the active callout is a drop to claim.
const callout = inst.props?.callouts?.[0] || inst.props?.pinnedCallout,
ctype = callout?.event?.type;
if ( ctype !== 'drop' || ! this.chat.context.get('chat.drops.auto-rewards') )
return;
const node = this.fine.getHostNode(inst),
btn = node.querySelector('button[data-a-target="chat-private-callout__primary-button"]');
inst._ffz_clicking = true;
if ( ! btn )
return;
// Wait for the button to be added to the DOM.
const waiter = this.resolve('site').awaitElement(
'button[data-a-target="chat-private-callout__primary-button"]',
this.fine.getHostNode(inst),
10000
);
btn.click();
waiter.then(btn => {
inst._ffz_clicking = false;
// Check AGAIN because time has passed.
const callout = inst.props?.callouts?.[0] || inst.props?.pinnedCallout,
ctype = callout?.event?.type;
if ( ctype !== 'drop' || ! this.chat.context.get('chat.drops.auto-rewards') )
return;
btn.click();
}).catch(() => {
inst._ffz_clicking = false;
});
}