From c43cddac311ec8dc6498c5ef3389af176481118f Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Tue, 28 Mar 2023 13:35:45 +0200 Subject: [PATCH] Fix inline preview in the majority of cases --- src/sites/twitch-twilight/modules/chat/input.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sites/twitch-twilight/modules/chat/input.jsx b/src/sites/twitch-twilight/modules/chat/input.jsx index ebeb2925..269cf3ea 100644 --- a/src/sites/twitch-twilight/modules/chat/input.jsx +++ b/src/sites/twitch-twilight/modules/chat/input.jsx @@ -224,8 +224,6 @@ export default class Input extends Module { for(const inst of this.ChatInput.instances) { this.installPreviewObserver(inst); inst.ffzInjectEmotes(); - inst.forceUpdate(); - this.emit('site:dom-update', 'chat-input', inst); } }); @@ -330,6 +328,7 @@ export default class Input extends Module { this.on('chat.emotes:update-default-sets', this.uncacheTabCompletion, this); this.on('chat.emotes:update-user-sets', this.uncacheTabCompletion, this); this.on('chat.emotes:update-room-sets', this.uncacheTabCompletion, this); + this.on('chat.emotes:loaded', this.uncacheTabCompletion, this); this.on('site.css_tweaks:update-chat-css', this.resizeInput, this); } @@ -505,6 +504,11 @@ export default class Input extends Module { this.props.emotes.splice(idx, 1, data); else if ( idx !== -1 && ! data ) this.props.emotes.splice(idx, 1); + + this.props.emotes = [...this.props.emotes]; + + inst.forceUpdate(); + t.emit('site:dom-update', 'chat-input', inst); } inst.componentDidUpdate = function(props, ...args) {