From b1d1f984762dae80dd87809aee7b8d1c52cfd9e1 Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Sat, 7 Sep 2019 19:57:30 +0200 Subject: [PATCH] Fix tab-completion duplicates by checking if the emote was added already (#651) --- src/sites/twitch-twilight/modules/chat/input.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sites/twitch-twilight/modules/chat/input.jsx b/src/sites/twitch-twilight/modules/chat/input.jsx index d4a04f2f..bfadad91 100644 --- a/src/sites/twitch-twilight/modules/chat/input.jsx +++ b/src/sites/twitch-twilight/modules/chat/input.jsx @@ -554,12 +554,13 @@ export default class Input extends Module { user && user.login, channel_id, channel_login - ); + ), + added_emotes = new Set(); for(const set of sets) { if ( set && set.emotes ) for(const emote of Object.values(set.emotes)) - if ( inst.doesEmoteMatchTerm(emote, search) ) { + if ( inst.doesEmoteMatchTerm(emote, search) && !added_emotes.has(emote.name) ) { const favorite = this.emotes.isFavorite(set.source || 'ffz', emote.id); results.push({ current: input, @@ -572,6 +573,7 @@ export default class Input extends Module { }), favorite }); + added_emotes.add(emote.name); } }