1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 01:56:55 +00:00

Fix tab-completion duplicates by checking if the emote was added already (#651)

This commit is contained in:
Lordmau5 2019-09-07 19:57:30 +02:00 committed by Mike
parent 6cb585d7d4
commit b1d1f98476

View file

@ -554,12 +554,13 @@ export default class Input extends Module {
user && user.login, user && user.login,
channel_id, channel_id,
channel_login channel_login
); ),
added_emotes = new Set();
for(const set of sets) { for(const set of sets) {
if ( set && set.emotes ) if ( set && set.emotes )
for(const emote of Object.values(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); const favorite = this.emotes.isFavorite(set.source || 'ffz', emote.id);
results.push({ results.push({
current: input, current: input,
@ -572,6 +573,7 @@ export default class Input extends Module {
}), }),
favorite favorite
}); });
added_emotes.add(emote.name);
} }
} }